re PR c++/37563 (Trouble calling qualified member function)
authorJason Merrill <jason@redhat.com>
Wed, 19 Nov 2008 19:36:38 +0000 (14:36 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 19 Nov 2008 19:36:38 +0000 (14:36 -0500)
        PR c++/37563
        * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
        name is not a declaration.

From-SVN: r142015

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

index 8ce3cfe3827f498a56070f553657152e36ca1357..12a826d7f3209323a0ec0ecabc4964d82ddc6299 100644 (file)
@@ -1,5 +1,9 @@
 2008-11-19  Jason Merrill  <jason@redhat.com>
 
+       PR c++/37563
+       * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
+       name is not a declaration.
+
        PR c++/37256
        * pt.c (instantiate_decl): Don't require a definition of
        a template that is explicitly instantiated 'extern'.
index 5c1f849a60783b5b56b704c26fb4f22f1073beb0..2bf0e66cd0357cd1b41764954b65fee53d7a5e18 100644 (file)
@@ -5264,7 +5264,7 @@ cp_parser_pseudo_destructor_name (cp_parser* parser,
                                            /*typename_keyword_p=*/false,
                                            /*check_dependency_p=*/true,
                                            /*type_p=*/false,
-                                           /*is_declaration=*/true)
+                                           /*is_declaration=*/false)
        != NULL_TREE);
   /* Now, if we saw a nested-name-specifier, we might be doing the
      second production.  */
index 53a99dedc5d867b64b97ac6d0704b5447f594ccb..f1f6c28eef868d7d3b9b05fd786f2040bd920e81 100644 (file)
@@ -1,5 +1,8 @@
 2008-11-19  Jason Merrill  <jason@redhat.com>
 
+       PR c++/37563
+       * g++.dg/template/pseudodtor5.C: New test.
+
        PR c++/37256
        * g++.dg/cpp0x/extern_template-3.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/template/pseudodtor5.C b/gcc/testsuite/g++.dg/template/pseudodtor5.C
new file mode 100644 (file)
index 0000000..751e662
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/37563
+
+struct A {};
+
+template<int> struct Traits
+{
+  typedef void X;
+};
+
+template<> struct Traits<0>
+{
+  typedef A X;
+};
+
+template<int N> struct B
+{
+  typedef typename Traits<N>::X Y;
+
+  void foo(Y y)
+  {
+    y.Y::A::~A();
+  }
+};