From 3d17be83c1e1e64828bf0e5181cbde99f722232d Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 17 Mar 2015 13:38:25 -0400 Subject: [PATCH] re PR c++/65061 (Issue with using declaration and member class template) PR c++/65061 * parser.c (cp_parser_template_name): Call strip_using_decl. From-SVN: r221478 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/parser.c | 2 ++ gcc/testsuite/g++.dg/inherit/using8.C | 15 +++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/inherit/using8.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b4fff5085e8..01484bf2604 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-16 Jason Merrill + + PR c++/65061 + * parser.c (cp_parser_template_name): Call strip_using_decl. + 2015-03-16 Marek Polacek DR 1688 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index a209ee608fa..a18f38ce0af 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -14051,6 +14051,8 @@ cp_parser_template_name (cp_parser* parser, /*ambiguous_decls=*/NULL, token->location); + decl = strip_using_decl (decl); + /* If DECL is a template, then the name was a template-name. */ if (TREE_CODE (decl) == TEMPLATE_DECL) { diff --git a/gcc/testsuite/g++.dg/inherit/using8.C b/gcc/testsuite/g++.dg/inherit/using8.C new file mode 100644 index 00000000000..b7677c8f682 --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/using8.C @@ -0,0 +1,15 @@ +// PR c++/65061 + +struct B +{ + template + struct S {}; +}; + +struct D : B +{ + using B::S; + + template + void doIt(/*struct*/ S&); +}; -- 2.30.2