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
This commit is contained in:
Marek Polacek 2015-03-25 20:08:05 +00:00 committed by Marek Polacek
parent 2a924bb46c
commit 1cc57b5910
4 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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);

View File

@ -1,3 +1,8 @@
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

View File

@ -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" }
}