https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63198
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Status|UNCONFIRMED |NEW Last reconfirmed| |2014-09-08 Summary|[c++1y] decltype in |decltype in template |template function |function declaration yields |declaration yields spurious |spurious error |error | Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- struct X { using t1 = int; }; struct Y { X operator=(const Y&); } y; template <typename T> void f1(decltype(y = y)::t1); $ g++ -std=c++11 -c d.cc d.cc:3:50: error: variable or field ‘f1’ declared void template <typename T> void f1(decltype(y = y)::t1); ^ Using -std=c++1y is not necessary, this doesn't use any C++14 features. The error only happens if f1 is a template, and only seems to happen if the decltype expression uses the assignment operator, not any other expression I tried.