]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/34100 (ICE with vector attribute)
authorJakub Jelinek <jakub@redhat.com>
Fri, 16 Nov 2007 07:06:25 +0000 (08:06 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 16 Nov 2007 07:06:25 +0000 (08:06 +0100)
PR c++/34100
* pt.c (apply_late_template_attributes): Do nothing if decl's type is
error_mark_node.

* g++.dg/template/crash73.C: New test.

From-SVN: r130220

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

index efc48a95bd71a16d536b4f32e23393010983f723..00b18f84fd81e2e43023f92208923be98a33d1ee 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34100
+       * pt.c (apply_late_template_attributes): Do nothing if decl's type is
+       error_mark_node.
+
 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/34054
index 8a95ccf7f74dac52748057b797d4bfa0753e5b5b..5e1335f439ab8209eb13f28d28ae1952130e5838 100644 (file)
@@ -6622,7 +6622,11 @@ apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags,
       }
 
   if (DECL_P (*decl_p))
-    p = &DECL_ATTRIBUTES (*decl_p);
+    {
+      if (TREE_TYPE (*decl_p) == error_mark_node)
+       return;
+      p = &DECL_ATTRIBUTES (*decl_p);
+    }
   else
     p = &TYPE_ATTRIBUTES (*decl_p);
 
index 5d00b2d1d8502e0f697735ab21344e0754481631..ec46967d4c83eb82bea8b07f942529ad96e774bb 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34100
+       * g++.dg/template/crash73.C: New test.
+
 2007-11-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/23848
diff --git a/gcc/testsuite/g++.dg/template/crash73.C b/gcc/testsuite/g++.dg/template/crash73.C
new file mode 100644 (file)
index 0000000..5c3c87d
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/34100
+// { dg-do compile }
+
+template<typename T> struct A
+{
+  typedef typename T::X Y __attribute__((vector_size(8)));     // { dg-error "is not a class, struct" }
+};
+
+A<int> a;