diff options
| author | Jason Merrill <jason@redhat.com> | 2011-06-23 12:52:48 -0400 |
|---|---|---|
| committer | Jason Merrill <jason@gcc.gnu.org> | 2011-06-23 12:52:48 -0400 |
| commit | 012d5d2526e73eb98190fdabfd86e075ed5c7d50 (patch) | |
| tree | feb1e76edef896378861b84fbcf2443b81a3873a /gcc/cp/class.c | |
| parent | ece620047b5ef8033e0c066c73c857a4d820d507 (diff) | |
| download | gcc-012d5d2526e73eb98190fdabfd86e075ed5c7d50.zip gcc-012d5d2526e73eb98190fdabfd86e075ed5c7d50.tar.gz gcc-012d5d2526e73eb98190fdabfd86e075ed5c7d50.tar.bz2 | |
re PR c++/49440 (Invalid dynamic_cast for unnamed namespace)
PR c++/49440
* class.c (set_linkage_according_to_type): Just check TREE_PUBLIC
on the type's name.
From-SVN: r175340
Diffstat (limited to 'gcc/cp/class.c')
| -rw-r--r-- | gcc/cp/class.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 09444fb..9e387a6 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -677,21 +677,10 @@ get_vtable_name (tree type) the abstract. */ void -set_linkage_according_to_type (tree type, tree decl) +set_linkage_according_to_type (tree type ATTRIBUTE_UNUSED, tree decl) { - /* If TYPE involves a local class in a function with internal - linkage, then DECL should have internal linkage too. Other local - classes have no linkage -- but if their containing functions - have external linkage, it makes sense for DECL to have external - linkage too. That will allow template definitions to be merged, - for example. */ - if (no_linkage_check (type, /*relaxed_p=*/true)) - { - TREE_PUBLIC (decl) = 0; - DECL_INTERFACE_KNOWN (decl) = 1; - } - else - TREE_PUBLIC (decl) = 1; + TREE_PUBLIC (decl) = 1; + determine_visibility (decl); } /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE. |
