]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/39054 (ICE with invalid pseudo-dtor in template)
authorJason Merrill <jason@redhat.com>
Mon, 2 Feb 2009 19:57:29 +0000 (14:57 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 2 Feb 2009 19:57:29 +0000 (14:57 -0500)
        PR c++/39054
        * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
        in BIT_NOT_EXPR.

From-SVN: r143879

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

index 5a99a16453e311629f324a872056877a74330e59..ee9a08fb996c2bcc49ecfae9037d9ee6e3475f3a 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-02  Jason Merrill  <jason@redhat.com>
+
+       PR c++/39054
+       * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
+       in BIT_NOT_EXPR.
+
 2009-01-26  Jason Merrill  <jason@redhat.com>
 
        PR c++/23287
index 2181275b5e4b1fa3cf8804fbd1885c3b6195f0e1..463fc5436772f46c2bfdad64f3c4887316a858e5 100644 (file)
@@ -3807,7 +3807,9 @@ cp_parser_unqualified_id (cp_parser* parser,
                /* We couldn't find a type with this name, so just accept
                   it and check for a match at instantiation time.  */
                type_decl = cp_parser_identifier (parser);
-               return build_nt (BIT_NOT_EXPR, type_decl);
+               if (type_decl != error_mark_node)
+                 type_decl = build_nt (BIT_NOT_EXPR, type_decl);
+               return type_decl;
              }
          }
        /* If an error occurred, assume that the name of the
index 4df4cf2522eecffcd8facd8cc35775a9d50ed8f8..54e2db01b5ca4104f861192362c4d5e861b98059 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-02  Jason Merrill  <jason@redhat.com>
+
+       PR c++/39054
+       * g++.dg/parse/dtor14.C: New test.
+
 2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline:
diff --git a/gcc/testsuite/g++.dg/parse/dtor14.C b/gcc/testsuite/g++.dg/parse/dtor14.C
new file mode 100644 (file)
index 0000000..6ba7a5b
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/39054
+
+struct A {};
+
+template<typename> void foo()
+{ 
+  A().~int();                  // { dg-error "expected" }
+}