// { dg-options "-std=c++0x" } struct S { int s; }; template <int N> void foo () { S s; decltype (s.s) i; } diagnoses: t.C: In function âvoid foo()â: t.C:6: error: type of âs.sâ is unknown t.C:6: error: invalid type in declaration before â;â token
(but compiles just fine when template <int N> line is commented out). Both 4.4 and trunk diagnose this. -- Summary: decltype error in template Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42277