[Issue 21373] New: extern(C++) ignored on template mixin declarations
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Nov  9 21:32:36 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=21373
          Issue ID: 21373
           Summary: extern(C++) ignored on template mixin declarations
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org
Test case:
========================================
extern(C++)
mixin template MTC()
{
    int foo(int i)
    {
        return i;
    }
}
mixin MTC!();
static assert(__traits(getLinkage, foo) == "C++");
========================================
The assert currently fails because the `extern(C++)` has no effect on foo,
causing __traits(getLinkage, foo) to return "D".
--
    
    
More information about the Digitalmars-d-bugs
mailing list