The following should be able to compile but does not: struct A { int i; }; template<int t> void foo() { ((struct A) { 0 }).i += 1; }
void g(void) { foo<0>(); } -------- If we remove the template on foo, the statement with compund literal expression is accepted. -- Summary: compound literal expression vs templates Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28766