Message ID | 20220126163930.1196807-1-jason@redhat.com |
---|---|
State | Committed |
Commit | 00d8321124123daf41f7c51526355a5a610cdeb8 |
Headers | show |
Series | [pushed] c++: ->template and using-decl [PR104235] | expand |
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index ed219d79dc9..8b38165020f 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -18680,7 +18680,8 @@ cp_parser_template_name (cp_parser* parser, cp_parser_error (parser, "expected template-name"); return error_mark_node; } - else if (!DECL_P (decl) && !is_overloaded_fn (decl)) + else if ((!DECL_P (decl) && !is_overloaded_fn (decl)) + || TREE_CODE (decl) == USING_DECL) /* Repeat the lookup at instantiation time. */ decl = identifier; } diff --git a/gcc/testsuite/g++.dg/parse/template-keyword2.C b/gcc/testsuite/g++.dg/parse/template-keyword2.C new file mode 100644 index 00000000000..ecd066787bc --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/template-keyword2.C @@ -0,0 +1,8 @@ +// PR c++/104235 + +template <class M> +struct L: M { + using M::a; + void a(); + void p() { this->template a<>(); } +};