[Issue 22631] ImportC: support C++11 unscoped enums with underlying type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 22 19:10:38 UTC 2022


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

--- Comment #4 from dave287091 at gmail.com ---
(In reply to Walter Bright from comment #3)
> I have not been able to get clang on my Mac to compile:
> 
>    enum E : char { A };
> 
> in a .c file.
> 
> > clang --version
> Apple LLVM version 9.0.0 (clang-900.0.39.2)
> Target: x86_64-apple-darwin16.7.0
> Thread model: posix
> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
> 
>  > cat test.c
> enum E : int
> {
>     A, B
> };
>  > clang -c test.c
> test.c:1:8: error: expected identifier or '('
> enum E : int
>        ^
> 1 error generated.

It compiles with the clang on my ubuntu box:

clang version 10.0.0-4ubuntu1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

As well as with the apple-clang on my MacBook:

Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Some brief probing in clang’s git repo shows it was turned on for all languages
clang compiles in 2018 with this commit:
https://github.com/llvm/llvm-project/commit/6f11db137034b38dbe2aabfa823ac0f2a7e3f9b9

--


More information about the Digitalmars-d-bugs mailing list