re PR c++/51813 (-fvisibility=hidden causes std::codecvt members to be undefined)

PR c++/51813
	* decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
	when reducing the visibility.

From-SVN: r183156
This commit is contained in:
Jason Merrill 2012-01-13 12:50:58 -05:00 committed by Jason Merrill
parent 4ce7d589fe
commit fc97053254
4 changed files with 23 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2012-01-13 Jason Merrill <jason@redhat.com>
PR c++/51813
* decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
when reducing the visibility.
PR c++/51620
* class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.

View File

@ -1984,6 +1984,8 @@ constrain_visibility (tree decl, int visibility, bool tmpl)
&& (tmpl || !DECL_VISIBILITY_SPECIFIED (decl)))
{
DECL_VISIBILITY (decl) = (enum symbol_visibility) visibility;
/* This visibility was not specified. */
DECL_VISIBILITY_SPECIFIED (decl) = false;
}
}

View File

@ -1,5 +1,8 @@
2012-01-13 Jason Merrill <jason@redhat.com>
PR c++/51813
* g++.dg/ext/visibility/template9.C: New.
PR c++/51620
* g++.dg/cpp0x/defaulted34.C: New.
* g++.dg/template/virtual3.C: New.

View File

@ -0,0 +1,14 @@
// PR c++/51813
// { dg-options -fvisibility=hidden }
// { dg-final { scan-assembler-not "hidden\\s+_ZN1N1fI1AEEvT" } }
struct A { };
namespace N __attribute((visibility("default"))) {
template <class T> void f(T) { }
extern template void f(A);
}
int main()
{
N::f(A());
}