PR c++/10749
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jun 2003 18:55:47 +0000 (18:55 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jun 2003 18:55:47 +0000 (18:55 +0000)
* parser.c (cp_parser_class_head): See through dependent names
when parsing a class-head.

PR c++/10749
* g++.dg/template/memclass2.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68276 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 8ed6d9c..88c91db 100644 (file)
@@ -1,5 +1,9 @@
 2003-06-20  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/10749
+       * parser.c (cp_parser_class_head): See through dependent names
+       when parsing a class-head.
+
        PR c++/10845
        * pt.c (try_class_unification): Correct handling of member class
        templates.
index ffb0bf8..4799944 100644 (file)
@@ -11634,7 +11634,7 @@ cp_parser_class_head (cp_parser* parser,
   nested_name_specifier 
     = cp_parser_nested_name_specifier_opt (parser,
                                           /*typename_keyword_p=*/false,
-                                          /*check_dependency_p=*/true,
+                                          /*check_dependency_p=*/false,
                                           /*type_p=*/false);
   /* If there was a nested-name-specifier, then there *must* be an
      identifier.  */
index dbb89db..9d8e410 100644 (file)
@@ -1,4 +1,9 @@
 2003-06-20  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/10749
+       * g++.dg/template/memclass2.C: New test.
+
+2003-06-20  Mark Mitchell  <mark@codesourcery.com>
             Eric Botcazou  <ebotcazou@libertysurf.fr>
        
        * lib/gcc-dg.exp (dg-xfail-if): Do not process conditional xfail
diff --git a/gcc/testsuite/g++.dg/template/memclass2.C b/gcc/testsuite/g++.dg/template/memclass2.C
new file mode 100644 (file)
index 0000000..da79d6a
--- /dev/null
@@ -0,0 +1,20 @@
+namespace ns {
+  template<typename T>
+  struct Foo {
+    template<typename U> struct Bar;
+  };
+  
+  template<typename T>
+  template<typename U>
+  struct Foo<T>::Bar {
+    template<typename V> struct Baz;
+  };
+  
+  template<typename T>
+  template<typename U>
+  template<typename V>
+  struct Foo<T>::Bar<U>::Baz {
+    Foo<T> chokes;
+    ns::Foo<T> works;
+  };
+}