]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/60415 (Bogus "invalid use of qualified-name")
authorJason Merrill <jason@redhat.com>
Tue, 4 Mar 2014 22:16:03 +0000 (17:16 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 4 Mar 2014 22:16:03 +0000 (17:16 -0500)
PR c++/60415
PR c++/54359
* parser.c (cp_parser_direct_declarator): Set declarator to
cp_error_declarator on invalid qualified-id.

From-SVN: r208332

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

index 0a12700bebce5c97a92934afb5682e9524f1d173..2ad6b7a3b59c4b391da86c7871a20eff1e2fad72 100644 (file)
@@ -1,3 +1,10 @@
+2014-03-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/60415
+       PR c++/54359
+       * parser.c (cp_parser_direct_declarator): Set declarator to
+       cp_error_declarator on invalid qualified-id.
+
 2014-03-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60376
index 413ada64abaf3019812189063ccceff8282721d4..bb7d2685f12148acb5d98dbe84f125679341395d 100644 (file)
@@ -17456,6 +17456,7 @@ cp_parser_direct_declarator (cp_parser* parser,
                  /* But declarations with qualified-ids can't appear in a
                     function.  */
                  cp_parser_error (parser, "qualified-id in declaration");
+                 declarator = cp_error_declarator;
                  break;
                }
              pushed_scope = push_scope (scope);
diff --git a/gcc/testsuite/g++.dg/parse/ambig8.C b/gcc/testsuite/g++.dg/parse/ambig8.C
new file mode 100644 (file)
index 0000000..016df8a
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/60415
+
+namespace b {
+  enum type_t { warning };
+}
+
+struct d {
+  d(b::type_t) { }
+  int operator()() { return 0; }
+};
+
+int main()
+{
+  d(b::warning)() + 1;
+}