]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/35077 (ICE with attribute in broken class declaration)
authorPaolo Carlini <pcarlini@suse.de>
Mon, 11 Feb 2008 09:28:48 +0000 (09:28 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 11 Feb 2008 09:28:48 +0000 (09:28 +0000)
cp/
2008-02-11  Paolo Carlini  <pcarlini@suse.de>

PR c++/35077
* decl.c (groktypename): Check grokdeclarator return.

testsuite/
2008-02-11  Paolo Carlini  <pcarlini@suse.de>

PR c++/35077
* g++.dg/template/crash78.C: New.

From-SVN: r132237

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

index 9dc4362acc34277857e84e9ad0dfe0835840eb7d..fe12e56cd266d2be921b57579d6acf589cd63ddd 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-11  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/35077
+       * decl.c (groktypename): Check grokdeclarator return.
+
 2008-02-10  Jason Merrill  <jason@redhat.com>
 
        PR c++/34094
index 6b807125d9d8818268a8f2ce4d49033bcb47427c..72949301370ea66d84810130697b86755741eae0 100644 (file)
@@ -3914,7 +3914,7 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
   attrs = type_specifiers->attributes;
   type_specifiers->attributes = NULL_TREE;
   type = grokdeclarator (declarator, type_specifiers, TYPENAME, 0, &attrs);
-  if (attrs)
+  if (attrs && type != error_mark_node)
     {
       if (CLASS_TYPE_P (type))
        warning (OPT_Wattributes, "ignoring attributes applied to class type %qT "
index aa851c180420a81aef41a8405b58559bdf986965..4ac18352c3f35ec02a2032a26349f04f5d5be08d 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-11  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/35077
+       * g++.dg/template/crash78.C: New.
+
 2008-02-11  Uros Bizjak  <ubizjak@gmail.com>
 
        PR testsuite/35047
diff --git a/gcc/testsuite/g++.dg/template/crash78.C b/gcc/testsuite/g++.dg/template/crash78.C
new file mode 100644 (file)
index 0000000..10c36ef
--- /dev/null
@@ -0,0 +1,3 @@
+// PR c++/35077
+
+template<typename=int struct A __attribute((aligned(4))); // { dg-error "declaration|expected" }