www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21219] New: Invalid C++ header generated for extern(C++,


          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 puremagic.com
          Reporter: moonlightsentinel 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.

Sep 03 2020