compile error while use `extern(C++, class)`

Johan Engelen via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 18 09:19:41 PDT 2016


On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta 
wrote:
> On Thursday, 18 August 2016 at 11:11:10 UTC, mogu wrote:
>>
>> Compiler Error exactly. The minimal code is(dmd or ldc2 in 
>> ubuntu 16.04 lts):
>> ```
>> extern (C++, struct)
>> class A {}
>> ```
>>
>> Error: identifier expected for C++ namespace found 'struct' 
>> when expecting ')' declaration expected, not ')'
>
> Which compiler version are you using? On DMD 2.071.0 this does 
> not work.

Note: this does work with LDC 1.1.0 even though it is based on 
DMD 2.071.

https://github.com/ldc-developers/ldc/releases/tag/v1.1.0-beta2



More information about the Digitalmars-d-learn mailing list