re PR c++/65061 (Issue with using declaration and member class template)
authorJason Merrill <jason@redhat.com>
Tue, 17 Mar 2015 17:38:25 +0000 (13:38 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 17 Mar 2015 17:38:25 +0000 (13:38 -0400)
PR c++/65061
* parser.c (cp_parser_template_name): Call strip_using_decl.

From-SVN: r221478

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/g++.dg/inherit/using8.C [new file with mode: 0644]

index b4fff5085e886c7f2db7eafc35905b59dec04ce2..01484bf260419c042816fac9f53ca10d40740742 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/65061
+       * parser.c (cp_parser_template_name): Call strip_using_decl.
+
 2015-03-16  Marek Polacek  <polacek@redhat.com>
 
        DR 1688
index a209ee608fadd89f0bd23c4b1e34ab01e8bc7120..a18f38ce0af87ffe03a67e35770f91172657fb49 100644 (file)
@@ -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 (file)
index 0000000..b7677c8
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/65061
+
+struct B
+{
+  template<typename T>
+  struct S {};
+};
+
+struct D : B
+{
+  using B::S;
+
+  template<typename T>
+  void doIt(/*struct*/ S<T>&);
+};