diff options
author | Mark Mitchell <mark@codesourcery.com> | 2009-05-22 14:57:15 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2009-05-22 14:57:15 +0000 |
commit | fe2978fba2ed2c3be0d1cd6ca3e1de30bd07bf93 (patch) | |
tree | 82c98fa46c401882eeff8896e21978996bb0fc84 /gcc/tree.c | |
parent | e4c29fbc9e0c826fac5586555d54db657d7b2382 (diff) | |
download | gcc-fe2978fba2ed2c3be0d1cd6ca3e1de30bd07bf93.zip gcc-fe2978fba2ed2c3be0d1cd6ca3e1de30bd07bf93.tar.gz gcc-fe2978fba2ed2c3be0d1cd6ca3e1de30bd07bf93.tar.bz2 |
tree.c (handle_dll_attribute): Mark dllexport'd inlines as non-external.
gcc/
* tree.c (handle_dll_attribute): Mark dllexport'd inlines as
non-external.
gcc/cp
* decl2.c (decl_needed_p): Consider dllexport'd functions needed.
* semantics.c (expand_or_defer_fn): Similarly.
gcc/testsuite/
* gcc.dg/dll-6.c: New test.
* gcc.dg/dll-6a.c: Likewise.
* gcc.dg/dll-7.c: Likewise.
* gcc.dg/dll-7a.c: Likewise.
* g++.dg/ext/dllexport2.C: Likewise.
* g++.dg/ext/dllexport2a.cc: Likewise.
From-SVN: r147799
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -4075,6 +4075,7 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags, bool *no_add_attrs) { tree node = *pnode; + bool is_dllimport; /* These attributes may apply to structure and union types being created, but otherwise should pass to the declaration involved. */ @@ -4122,9 +4123,11 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags, return NULL_TREE; } + is_dllimport = is_attribute_p ("dllimport", name); + /* Report error on dllimport ambiguities seen now before they cause any damage. */ - else if (is_attribute_p ("dllimport", name)) + if (is_dllimport) { /* Honor any target-specific overrides. */ if (!targetm.valid_dllimport_attribute_p (node)) @@ -4166,6 +4169,9 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags, if (*no_add_attrs == false) DECL_DLLIMPORT_P (node) = 1; } + else if (DECL_DECLARED_INLINE_P (node)) + /* An exported function, even if inline, must be emitted. */ + DECL_EXTERNAL (node) = 0; /* Report error if symbol is not accessible at global scope. */ if (!TREE_PUBLIC (node) |