← Back to index
|
Original Bugzilla link
Bug 13238 – getMember trait changes function linkage
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-08-01T18:10:37Z
Last change time
2020-03-21T03:56:40Z
Assigned to
No Owner
Creator
Vlad Levenfeld
Comments
Comment #0
by vlevenfeld — 2014-08-01T18:10:37Z
struct Foo { extern (C) void function (int*) func; } struct Bar { static string code () { string code; foreach (symbol; __traits (allMembers, typeof(this))) static if (is(typeof(__traits (getMember, typeof(this), symbol)))) {} return code; } extern (C) void function (int*) func; mixin(code); } struct Baz { static string code () { string code; foreach (symbol; __traits (allMembers, typeof(this))) static if (is(typeof(__traits (getMember, typeof(this), symbol)))) {} return code; } mixin(code); extern (C) void function (int*) func; } void main () { static assert (functionLinkage!(typeof(Foo.func)) == `C`); static assert (functionLinkage!(typeof(Bar.func)) == `C`); static assert (functionLinkage!(typeof(Baz.func)) == `D`); // BUG why? }