D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20745 - __traits(getLinkage, T) returns "D" for extern (C) struct T
Summary: __traits(getLinkage, T) returns "D" for extern (C) struct T
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-17 16:50 UTC by karita
Modified: 2020-04-17 16:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description karita 2020-04-17 16:50:27 UTC
The following code reproduces the wrong linkage result.

---

// https://wandbox.org/permlink/0kSYkUvi82gW9kRR

extern (C) struct T {}

void main() {
    assert(__traits(getLinkage, T) == "D"); // should be C
}
Comment 1 karita 2020-04-17 16:56:51 UTC
Sorry I misunderstood.