mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-22 22:01:20 +08:00
re PR c/88568 ('dllimport' no longer implies 'extern' in C)
PR c/88568 * attribs.c (handle_dll_attribute): Don't clear TREE_STATIC for dllimport on VAR_DECLs with RECORD_TYPE or UNION_TYPE DECL_CONTEXT. * g++.dg/other/pr88568.C: New test. From-SVN: r269525
This commit is contained in:
parent
04e5c73db8
commit
3568d2d5fa
@ -1,5 +1,9 @@
|
||||
2019-03-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c/88568
|
||||
* attribs.c (handle_dll_attribute): Don't clear TREE_STATIC for
|
||||
dllimport on VAR_DECLs with RECORD_TYPE or UNION_TYPE DECL_CONTEXT.
|
||||
|
||||
PR target/79645
|
||||
* common.opt (fdiagnostics-show-labels,
|
||||
fdiagnostics-show-line-numbers, fdiagnostics-format=,
|
||||
|
@ -1691,8 +1691,11 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
|
||||
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)
|
||||
|
@ -1,5 +1,8 @@
|
||||
2019-03-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c/88568
|
||||
* g++.dg/other/pr88568.C: New test.
|
||||
|
||||
PR rtl-optimization/89634
|
||||
* gcc.c-torture/execute/pr89634.c: New test.
|
||||
|
||||
|
13
gcc/testsuite/g++.dg/other/pr88568.C
Normal file
13
gcc/testsuite/g++.dg/other/pr88568.C
Normal file
@ -0,0 +1,13 @@
|
||||
// PR c/88568
|
||||
// { dg-do compile }
|
||||
// { dg-require-dll "" }
|
||||
|
||||
struct S {
|
||||
__attribute__((dllimport)) static const char foo[];
|
||||
};
|
||||
|
||||
int
|
||||
foo (int x)
|
||||
{
|
||||
return S::foo[x];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user