re PR c++/54883 (Name mangling of types in an unnamed namespace)

PR c++/54883
	* decl2.c (min_vis_r): Handle anon visibility for enums.

From-SVN: r194430
This commit is contained in:
Jason Merrill 2012-12-11 17:46:08 -05:00 committed by Jason Merrill
parent 3c523cf8a8
commit efa6d698dc
3 changed files with 17 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2012-12-11 Jason Merrill <jason@redhat.com>
PR c++/54883
* decl2.c (min_vis_r): Handle anon visibility for enums.
2012-12-11 Marc Glisse <marc.glisse@inria.fr>
PR c++/53094

View File

@ -1926,16 +1926,15 @@ min_vis_r (tree *tp, int *walk_subtrees, void *data)
{
*walk_subtrees = 0;
}
else if (CLASS_TYPE_P (*tp))
else if (TAGGED_TYPE_P (*tp)
&& !TREE_PUBLIC (TYPE_MAIN_DECL (*tp)))
{
if (!TREE_PUBLIC (TYPE_MAIN_DECL (*tp)))
{
*vis_p = VISIBILITY_ANON;
return *tp;
}
else if (CLASSTYPE_VISIBILITY (*tp) > *vis_p)
*vis_p = CLASSTYPE_VISIBILITY (*tp);
*vis_p = VISIBILITY_ANON;
return *tp;
}
else if (CLASS_TYPE_P (*tp)
&& CLASSTYPE_VISIBILITY (*tp) > *vis_p)
*vis_p = CLASSTYPE_VISIBILITY (*tp);
return NULL;
}

View File

@ -0,0 +1,5 @@
// PR c++/54883
namespace { enum E { E1 }; } void f(E e) { }
// { dg-final { scan-assembler-not "globl" } }