Skip to content

Commit 9451885

Browse files
authored
Merge pull request #2361 from TurkeyMan/getLinkage_class
Update getLinkage merged-on-behalf-of: Mike Franklin <JinShil@users.noreply.github.com>
2 parents 81d8000 + 98c11a7 commit 9451885

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec/traits.dd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ pragma(msg, __traits(getFunctionAttributes, (int x) @trusted { return x * 2; }))
600600

601601
$(H2 $(GNAME getLinkage))
602602

603-
$(P Takes one argument, which is a declaration symbol, or the type of a function,
604-
delegate, or pointer to function.
603+
$(P Takes one argument, which is a declaration symbol, or the type of a function, delegate,
604+
pointer to function, class, or interface.
605605
Returns a string representing the $(LINK2 attribute.html#LinkageAttribute, LinkageAttribute)
606606
of the declaration.
607607
The string is one of:
@@ -623,6 +623,12 @@ alias aliasc = fooc;
623623

624624
static assert(__traits(getLinkage, fooc) == "C");
625625
static assert(__traits(getLinkage, aliasc) == "C");
626+
627+
extern (C++) class FooCPP {}
628+
extern (C++) interface FooCPPInterface {}
629+
630+
static assert(__traits(getLinkage, FooCPP) == "C++");
631+
static assert(__traits(getLinkage, FooCPPInterface) == "C++");
626632
---
627633

628634
$(H2 $(GNAME getMember))

0 commit comments

Comments
 (0)