diff options
author | Marek Polacek <polacek@redhat.com> | 2015-03-25 20:08:05 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-03-25 20:08:05 +0000 |
commit | 1cc57b591076b3185ba40687a26c0c9c454fcb23 (patch) | |
tree | ad94fffe5af6186e342198e2cc2f3e7b3d2e69d6 /gcc | |
parent | 2a924bb46cd43165272ce6f1720710c38beb2c24 (diff) | |
download | gcc-1cc57b591076b3185ba40687a26c0c9c454fcb23.zip gcc-1cc57b591076b3185ba40687a26c0c9c454fcb23.tar.gz gcc-1cc57b591076b3185ba40687a26c0c9c454fcb23.tar.bz2 |
re PR c++/65558 (crash using __attribute__((__abi_tag__)) on anonymous inline namespace)
PR c++/65558
* name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
on an anonymous namespace.
* g++.dg/cpp0x/pr65558.C: New test.
From-SVN: r221672
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr65558.C | 6 |
4 files changed, 23 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65e1912..4ba45d7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2015-03-25 Marek Polacek <polacek@redhat.com> + PR c++/65558 + * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute + on an anonymous namespace. + +2015-03-25 Marek Polacek <polacek@redhat.com> + PR c++/61670 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b85fbc9..4303ed5 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3663,6 +3663,12 @@ handle_namespace_attrs (tree ns, tree attributes) "namespace", name); continue; } + if (!DECL_NAME (ns)) + { + warning (OPT_Wattributes, "ignoring %qD attribute on anonymous " + "namespace", name); + continue; + } if (!args) { tree dn = DECL_NAME (ns); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c8f9033..68534fc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2015-03-25 Marek Polacek <polacek@redhat.com> + PR c++/65558 + * g++.dg/cpp0x/pr65558.C: New test. + +2015-03-25 Marek Polacek <polacek@redhat.com> + PR c++/61670 * g++.dg/template/pr61670.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr65558.C b/gcc/testsuite/g++.dg/cpp0x/pr65558.C new file mode 100644 index 0000000..5437e50 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr65558.C @@ -0,0 +1,6 @@ +// PR c++/65558 +// { dg-do compile { target c++11 } } + +inline namespace __attribute__((__abi_tag__)) +{ // { dg-warning "ignoring .__abi_tag__. attribute on anonymous namespace" } +} |