aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-04-11 13:55:12 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-04-11 13:55:12 -0400
commit701bd2a2ccb8b091e0d08e62bb371d8cc0ed13a7 (patch)
tree4b1a4040cb42a0e7ca224d62611f525de4005b50
parentadee67b338a5ead5ac96d97a81c9bd47cd6b80b1 (diff)
downloadgcc-701bd2a2ccb8b091e0d08e62bb371d8cc0ed13a7.zip
gcc-701bd2a2ccb8b091e0d08e62bb371d8cc0ed13a7.tar.gz
gcc-701bd2a2ccb8b091e0d08e62bb371d8cc0ed13a7.tar.bz2
re PR c++/52906 (ICE: SIGSEGV in check_tag_decl (decl.c:4230) with "__attribute__ ((__deprecated__));" alone)
PR c++/52906 * decl.c (check_tag_decl): Don't complain about attributes if we don't even have a type. From-SVN: r186345
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib45.C3
4 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3397470..1f34600 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/52906
+ * decl.c (check_tag_decl): Don't complain about attributes if we
+ don't even have a type.
+
2012-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
* cvt.c (convert_to_void): Update comment.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e2f01d5..8b221929 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4224,7 +4224,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
error ("%<constexpr%> cannot be used for type declarations");
}
- if (declspecs->attributes && warn_attributes)
+ if (declspecs->attributes && warn_attributes && declared_type)
{
location_t loc;
if (!CLASS_TYPE_P (declared_type)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3355e7e..5fbbcfc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2012-04-11 Jason Merrill <jason@redhat.com>
+ PR c++/52906
+ * g++.dg/ext/attrib45.C: New.
+
* g++.dg/eh/dtor3.C: New.
2012-04-11 Richard Guenther <rguenther@suse.de>
diff --git a/gcc/testsuite/g++.dg/ext/attrib45.C b/gcc/testsuite/g++.dg/ext/attrib45.C
new file mode 100644
index 0000000..0be1322
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib45.C
@@ -0,0 +1,3 @@
+// PR c++/52906
+
+__attribute__ ((__deprecated__)); // { dg-error "does not declare anything" }