OSDN Git Service

PR c++/39054
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Feb 2009 18:38:10 +0000 (18:38 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Feb 2009 18:38:10 +0000 (18:38 +0000)
        * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
        in BIT_NOT_EXPR.

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

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

index eeec03d..50fe9c2 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-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
 
         PR c++/39053
index 5675e9b..138fe42 100644 (file)
@@ -3896,7 +3896,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 828af3f..d6adb2e 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-02-02  Jakub Jelinek  <jakub@redhat.com>
 
        * lib/target-supports.exp
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" }
+}