]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/9639 ([New parser] Namespace std in constructor argument lists on illegal...
authorMark Mitchell <mark@codesourcery.com>
Mon, 17 Mar 2003 17:36:24 +0000 (17:36 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 17 Mar 2003 17:36:24 +0000 (17:36 +0000)
PR c++/9639
* parser.c (cp_parser_declarator_id): Clear parser->scope.

PR c++/9639
* g++.dg/parse/crash1.C: New test.

From-SVN: r64495

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

index 2439eddb630589530016f3b8a251aaf084ceb258..2987491aed5b7f7ca560574293fabe1745c48d5b 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-17  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/9639
+       * parser.c (cp_parser_declarator_id): Clear parser->scope.
+
 2003-03-16  Jason Merrill  <jason@redhat.com>
 
        PR c++/9993
index f80c260f42627e607687a2a59031524a7ce01d47..9c157c29a0a96a5d12e04696b203988c84392cdc 100644 (file)
@@ -10424,7 +10424,10 @@ cp_parser_declarator_id (cp_parser* parser)
   /* If the name was qualified, create a SCOPE_REF to represent 
      that.  */
   if (parser->scope)
-    id_expression = build_nt (SCOPE_REF, parser->scope, id_expression);
+    {
+      id_expression = build_nt (SCOPE_REF, parser->scope, id_expression);
+      parser->scope = NULL_TREE;
+    }
 
   return id_expression;
 }
index 34d6e0095616d365dc98b3109be0508666563392..bb24a38882f2ec2a5f360bd97ce16fff177571f1 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-17  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/9639
+       * g++.dg/parse/crash1.C: New test. 
+
 2003-03-16  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/8805
diff --git a/gcc/testsuite/g++.dg/parse/crash1.C b/gcc/testsuite/g++.dg/parse/crash1.C
new file mode 100644 (file)
index 0000000..750ed18
--- /dev/null
@@ -0,0 +1 @@
+struct s { s(std::b o) { } }; // { dg-error "" }