www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23567] New: pragma(printf) messes up with the vtable of

https://issues.dlang.org/show_bug.cgi?id=23567

          Issue ID: 23567
           Summary: pragma(printf) messes up with the vtable of
                    extern(C++) classes
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: naydef abv.bg

assertion fails on DMD 2.101.1
assertion passes on DMD 2.100.2

app.d
-------------------------------------------------------
extern(C++) abstract class CCvar
{
public:
    pragma(printf) void func1(const(char)* pFormat, ...);
    pragma(printf) void func2(const(char)* pFormat, ...);
}

static assert(__traits(getVirtualIndex, CCvar.func2) == 1);
pragma(msg, __traits(getVirtualIndex, CCvar.func2));

void main() {}
-------------------------------------------------------

dmd -o- app.d


Thanks to CyberShadow for bisecting. Issue introduced in
https://github.com/dlang/dmd/pull/14503

--
Dec 18 2022