aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2007-06-23 19:17:04 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2007-06-23 19:17:04 +0000
commit3a687f8bbb2c222ed8752901976f638a1980e854 (patch)
tree68bf248eebd2d13665cd9f9a10d25b6810ef5803 /gcc/cp
parente36711f3cd476b24b011f18953aa3ed3e9a70a36 (diff)
downloadgcc-3a687f8bbb2c222ed8752901976f638a1980e854.zip
gcc-3a687f8bbb2c222ed8752901976f638a1980e854.tar.gz
gcc-3a687f8bbb2c222ed8752901976f638a1980e854.tar.bz2
extend.texi: Document that dllimport and dllexport imply default visibility.
2007-06-23 Mark Mitchell <mark@codesourcery.com> * doc/extend.texi: Document that dllimport and dllexport imply default visibility. * tree.c (handle_dll_attribute): Set DECL_VISIBILITY on the imported or exported declaration, including type declarations. * c-common.c (handle_visibility_attribute): Check for conflicts with dllimport/dllexport. (c_determine_visibility): Handle dllimport/dllexport as an explicit visibility atttribute. 2007-06-23 Mark Mitchell <mark@codesourcery.com> * decl2.c (determine_visibility): Don't look for dllexport here. (determine_visibility_from_class): Tidy. 2007-06-23 Mark Mitchell <mark@codesourcery.com> * gcc.dg/visibility-12.c: New test. * gcc.dg/visibility-13.c: Likewise. * g++.dg/ext/visibility-9.C: Likewise. * g++.dg/ext/visibility-10.C: Likewise. From-SVN: r125975
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c18
2 files changed, 9 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 609b80c..951faf4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-23 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (determine_visibility): Don't look for dllexport here.
+ (determine_visibility_from_class): Tidy.
+
2007-06-18 Simon Baldwin <simonb@google.com>
PR c++/31923
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 52953b2..b745183 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1684,17 +1684,6 @@ determine_visibility (tree decl)
else
use_template = 0;
- /* Anything that is exported must have default visibility. */
- if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
- && lookup_attribute ("dllexport",
- TREE_CODE (decl) == TYPE_DECL
- ? TYPE_ATTRIBUTES (TREE_TYPE (decl))
- : DECL_ATTRIBUTES (decl)))
- {
- DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
- DECL_VISIBILITY_SPECIFIED (decl) = 1;
- }
-
/* If DECL is a member of a class, visibility specifiers on the
class can influence the visibility of the DECL. */
if (DECL_CLASS_SCOPE_P (decl))
@@ -1796,18 +1785,20 @@ determine_visibility (tree decl)
static void
determine_visibility_from_class (tree decl, tree class_type)
{
+ if (DECL_VISIBILITY_SPECIFIED (decl))
+ return;
+
if (visibility_options.inlines_hidden
/* Don't do this for inline templates; specializations might not be
inline, and we don't want them to inherit the hidden
visibility. We'll set it here for all inline instantiations. */
&& !processing_template_decl
- && ! DECL_VISIBILITY_SPECIFIED (decl)
&& TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl)
&& (! DECL_LANG_SPECIFIC (decl)
|| ! DECL_EXPLICIT_INSTANTIATION (decl)))
DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
- else if (!DECL_VISIBILITY_SPECIFIED (decl))
+ else
{
/* Default to the class visibility. */
DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type);
@@ -1826,7 +1817,6 @@ determine_visibility_from_class (tree decl, tree class_type)
&& !DECL_CONSTRUCTION_VTABLE_P (decl)))
&& TREE_PUBLIC (decl)
&& !DECL_REALLY_EXTERN (decl)
- && !DECL_VISIBILITY_SPECIFIED (decl)
&& !CLASSTYPE_VISIBILITY_SPECIFIED (class_type))
targetm.cxx.determine_class_data_visibility (decl);
}