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:
parent
3c523cf8a8
commit
efa6d698dc
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
5
gcc/testsuite/g++.dg/abi/anon1.C
Normal file
5
gcc/testsuite/g++.dg/abi/anon1.C
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/54883
|
||||
|
||||
namespace { enum E { E1 }; } void f(E e) { }
|
||||
|
||||
// { dg-final { scan-assembler-not "globl" } }
|
Loading…
Reference in New Issue
Block a user