https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67033
Bug ID: 67033 Summary: [c++11] template argument invalid for integral constant expression beginning with address-of expression Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ed at catmur dot co.uk Target Milestone: --- template<bool B> struct S { }; int x; S<&x == &x> s; // error: template argument 1 is invalid // ^ &x == &x is a valid converted constant expression of type bool. The problem is that cp_parser_template_argument sees the initial '&' and decides that the non-type template argument must be the address-of operator applied to an id-expression; when it fails to reach the end of the template argument it aborts. This behavior is valid for <= C++03, where '&' cannot appear in a constant expression, but C++11 is more relaxed.