From: Jakub Jelinek Date: Fri, 16 Nov 2007 07:06:25 +0000 (+0100) Subject: re PR c++/34100 (ICE with vector attribute) X-Git-Tag: releases/gcc-4.3.0~1491 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=823e5f7f9fb52d8e6a9bb2c97164cc593ae18e11;p=thirdparty%2Fgcc.git re PR c++/34100 (ICE with vector attribute) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index efc48a95bd71..00b18f84fd81 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-11-16 Jakub Jelinek + + PR c++/34100 + * pt.c (apply_late_template_attributes): Do nothing if decl's type is + error_mark_node. + 2007-11-13 Jakub Jelinek PR c++/34054 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 8a95ccf7f74d..5e1335f439ab 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5d00b2d1d850..ec46967d4c83 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-11-16 Jakub Jelinek + + PR c++/34100 + * g++.dg/template/crash73.C: New test. + 2007-11-15 Jakub Jelinek 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 index 000000000000..5c3c87dad7a4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash73.C @@ -0,0 +1,9 @@ +// PR c++/34100 +// { dg-do compile } + +template struct A +{ + typedef typename T::X Y __attribute__((vector_size(8))); // { dg-error "is not a class, struct" } +}; + +A a;