OSDN Git Service

* cp-tree.h (get_arglist_len_in_bytes): Remove.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jan 2003 00:16:12 +0000 (00:16 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jan 2003 00:16:12 +0000 (00:16 +0000)
PR c++/9264
* parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
typeame types more robustly.

PR c++/9172
* g++.dg/parse/typename1.C: New file.

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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/testsuite/g++.dg/parse/typename1.C [new file with mode: 0644]

index 47dc6fa..4111b95 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * cp-tree.h (get_arglist_len_in_bytes): Remove.
+
+       PR c++/9264
+       * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
+       typeame types more robustly.
+
 2003-01-11  Phil Edwards  <pme@gcc.gnu.org>
 
        * parser.c:  Fix comment typos.
index a9d4f2b..313b124 100644 (file)
@@ -3581,7 +3581,6 @@ extern GTY(()) operator_name_info_t assignment_operator_name_info
 
 /* in call.c */
 extern bool check_dtor_name (tree, tree);
-extern int get_arglist_len_in_bytes            (tree);
 
 extern tree build_vfield_ref                   (tree, tree);
 extern tree build_scoped_method_call (tree, tree, tree, tree);
index acbfd11..21d5d21 100644 (file)
@@ -9012,10 +9012,14 @@ cp_parser_elaborated_type_specifier (parser, is_friend, is_declaration)
                              /*current_scope_valid_p=*/false);
   /* Look for the nested-name-specifier.  */
   if (tag_type == typename_type)
-    cp_parser_nested_name_specifier (parser,
-                                    /*typename_keyword_p=*/true,
-                                    /*check_dependency_p=*/true,
-                                    /*type_p=*/true);
+    {
+      if (cp_parser_nested_name_specifier (parser,
+                                          /*typename_keyword_p=*/true,
+                                          /*check_dependency_p=*/true,
+                                          /*type_p=*/true) 
+         == error_mark_node)
+       return error_mark_node;
+    }
   else
     /* Even though `typename' is not present, the proposed resolution
        to Core Issue 180 says that in `class A<T>::B', `B' should be
diff --git a/gcc/testsuite/g++.dg/parse/typename1.C b/gcc/testsuite/g++.dg/parse/typename1.C
new file mode 100644 (file)
index 0000000..2af84e3
--- /dev/null
@@ -0,0 +1,5 @@
+template <class baz>
+struct bar
+{
+  typedef typename baz::typename rebind<int> foo; // { dg-error "" }
+};