OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Jun 2008 21:27:35 +0000 (21:27 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Jun 2008 21:27:35 +0000 (21:27 +0000)
2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/36404
        * pt.c (push_template_decl_real): Consistently return error_mark_node
on error.

/testsuite
2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/36404
        * g++.dg/template/crash79.C: New.
* g++.dg/other/pr28114.C: Adjust.

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

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr28114.C
gcc/testsuite/g++.dg/template/crash79.C [new file with mode: 0644]

index 6fe0199..54afddc 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
+
+        PR c++/36404
+        * pt.c (push_template_decl_real): Consistently return error_mark_node
+       on error.
+
 2008-06-02  Tomas Bily  <tbily@suse.cz>
 
         * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
index 95440c9..4bb43ad 100644 (file)
@@ -3791,7 +3791,10 @@ push_template_decl_real (tree decl, bool is_friend)
        member_template_p = true;
       if (TREE_CODE (decl) == TYPE_DECL
          && ANON_AGGRNAME_P (DECL_NAME (decl)))
-       error ("template class without a name");
+       {
+         error ("template class without a name");
+         return error_mark_node;
+       }
       else if (TREE_CODE (decl) == FUNCTION_DECL)
        {
          if (DECL_DESTRUCTOR_P (decl))
index 6cacd32..0bfe14a 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
+
+        PR c++/36404
+        * g++.dg/template/crash79.C: New.
+       * g++.dg/other/pr28114.C: Adjust.       
+
 2008-06-02  Daniel Kraft  <d@domob.eu>
 
        * finalize_1.f08:  New test.
index 05aeebb..e16f6b5 100644 (file)
@@ -5,5 +5,5 @@ template<int> void foo(struct {}*); // { dg-error "" }
 
 void bar()
 {
-  foo<0>(0); // { dg-error "" }
+  foo<0>(0);
 }
diff --git a/gcc/testsuite/g++.dg/template/crash79.C b/gcc/testsuite/g++.dg/template/crash79.C
new file mode 100644 (file)
index 0000000..be71848
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/36404
+
+struct A
+{
+  A(int);
+  template<int> enum { e }; // { dg-error "template" }
+};
+
+A a(A::e); // { dg-error "not a member" }