clang accepts 'enum struct' in C mode with warning despite being unusable · Issue #42372 · llvm/llvm-project (original) (raw)

Bugzilla Link 43027
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @WonHoYoo,@DougGregor,@garfr,@zygoloid

Extended Description

In C mode, Clang accepts this code with a warning:

enum struct Foo {
A
};

However, it is useless. None of the members seem to be accessible.

I've tried typedefs, ::, :, ., ->, casts, but nothing seems to allow me to access A.

Either these should be allowed as a documented extension with ::, or treated as a syntax error.