[Issue 21219] New: Invalid C++ header generated for extern(C++, [class|struct])

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 3 22:52:43 UTC 2020


          Issue ID: 21219
           Summary: Invalid C++ header generated for extern(C++,
           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


extern(C++, class) struct ClassFromStruct {}

extern(C++, class) class ClassFromClass {}

extern(C++, struct) struct StructFromStruct {}

extern(C++, struct) class StructFromClass {}

dmd  -c -o- -HC missing_class.d
// Automatically generated by Digital Mars D Compiler v2092

#pragma once

#include <stddef.h>
#include <stdint.h>

// ignoring non-cpp struct ClassFromStruct because of linkage
class ClassFromClass

// ignoring non-cpp struct StructFromStruct because of linkage
class StructFromClass

There are mutliple issues here:

- ClassFromStruct and StructFromStruct are missing
- StructFromClass is declared as class.


More information about the Digitalmars-d-bugs mailing list