mingw-gcc/gcc_bug_88568.patch
2019-04-16 16:44:56 +02:00

18 lines
778 B
Diff

diff -rupN gcc-8.3.0/gcc/attribs.c gcc-8.3.0-new/gcc/attribs.c
--- gcc-8.3.0/gcc/attribs.c 2019-02-07 15:26:06.000000000 +0100
+++ gcc-8.3.0-new/gcc/attribs.c 2019-04-16 15:58:04.405313950 +0200
@@ -1685,8 +1685,11 @@ handle_dll_attribute (tree * pnode, tree
a function global scope, unless declared static. */
if (current_function_decl != NULL_TREE && !TREE_STATIC (node))
TREE_PUBLIC (node) = 1;
- /* Clear TREE_STATIC because DECL_EXTERNAL is set. */
- TREE_STATIC (node) = 0;
+ /* Clear TREE_STATIC because DECL_EXTERNAL is set, unless
+ it is a C++ static data member. */
+ if (DECL_CONTEXT (node) == NULL_TREE
+ || !RECORD_OR_UNION_TYPE_P (DECL_CONTEXT (node)))
+ TREE_STATIC (node) = 0;
}
if (*no_add_attrs == false)