Issue 169472
Summary [Clang] Clang-cl mode is bug-compatible with MSVC on completeness of enumeration types
Labels clang-cl
Assignees
Reporter frederick-vs-ja
    The following example should be rejected, because `E` is an enumeration type without fixed underlying type and thus incomplete within it's enumerator list. However, Clang currently accepts in Clang-cl mode ([demo](https://godbolt.org/z/8sr87nnj9)).

```C++
enum E {
  n = sizeof(E),
};
```

[Another example](https://godbolt.org/z/rTsjf43s4) shows that the underlying type is assumed to be `int` here.

As MSVC is (incorrectly) doing the same, perhaps such behavior is kept for bug-compatibility. But given such "extension" can be undesired, because the underlying type can become another type when the enumeration becomes complete, perhaps we should consider turning it off by default, or even removing it one day.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to