https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70417
Bug ID: 70417 Summary: New g++6 rejects previously valid code Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jengelh at inai dot de CC: rguenther at suse dot de Target Milestone: --- ---8<--- template<class T> struct ref { template<class U> ref<U> dy() const { return ref<U>(); } }; template<class X, class Y> ref<X> dy(ref<Y> y) { return y.dy<X>(); } --->8--- gcc version 6.0.0 20160324 (experimental) [trunk revision 234449] (SUSE Linux) produces: t.cpp: In function ‘ref<X> dy(ref<Y>)’: t.cpp:5:15: error: expected primary-expression before ‘>’ token return y.dy<X>(); ^ t.cpp:5:17: error: expected primary-expression before ‘)’ token return y.dy<X>(); ^ Prior g++ versions, including * gcc version 4.8.5 (SUSE Linux) * gcc version 5.3.1 20160301 [gcc-5-branch revision 233849] (SUSE Linux) * and some un-rememberable g++6 "from last month or so" all accepted the code. Is there something new in the C++ standards, or is this a g++ regression?