This testcase demonstrates that my assumption that we would only be
interested in a class template lookup if the template-id is followed by ::
was wrong.
PR c++/106179
PR c++/106024
gcc/cp/ChangeLog:
* parser.cc (cp_parser_lookup_name): Remove :: requirement
for using unqualified lookup result.
gcc/testsuite/ChangeLog:
* g++.dg/template/operator16.C: New test.
looking at a template arg list. */
if (!cp_parser_skip_entire_template_parameter_list (parser))
decl = NULL_TREE;
- /* And only use the unqualified lookup if we're looking at ::. */
- if (decl
- && !cp_lexer_next_token_is (parser->lexer, CPP_SCOPE))
- decl = NULL_TREE;
}
/* If we know we're looking for a type (e.g. A in p->A::x),
--- /dev/null
+// PR c++/106179
+
+struct Mat {
+ template <typename> Mat();
+};
+template <typename> struct Mat_;
+template <typename _Tp> Mat::Mat() {
+ _Tp commaInitializer = commaInitializer.operator Mat_<_Tp>;
+}