diff options
author | Paolo Carlini <pcarlini@suse.de> | 2008-02-11 09:28:48 +0000 |
---|---|---|
committer | Paolo Carlini <pcarlini@suse.de> | 2008-02-11 09:28:48 +0000 |
commit | 467837fc0e0436dd98e8b71bfcd827d77d7bf56b (patch) | |
tree | a53a2d203a0cb1d7c6f78f45a7b9b1c5e0ce42d8 | |
parent | 6ca8527df5465de23c01b91d271607aec4dcb409 (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@132237 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash78.C | 3 |
4 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9dc4362acc3..fe12e56cd26 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 6b807125d9d..72949301370 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 " diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa851c18042..4ac18352c3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 00000000000..10c36ef8c38 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash78.C @@ -0,0 +1,3 @@ +// PR c++/35077 + +template<typename=int struct A __attribute((aligned(4))); // { dg-error "declaration|expected" } |