[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 8 16:58:07 PST 2024
shafik wrote:
> So I believe:
>
> ```
> typedef enum EnumA {
> A
> } EnumA;
>
> enum EnumB {
> B,
> B1 = 1,
> B2 = A == B1
> };
> ```
>
> is not an enum compare warning in C++ because `B1` doesn't have an enumeration type due to the enumeration not being fully-defined, and is not an enum compare warning in C because `A` has type `int` (due to p15) and `B1` has type `int` (due to p12).
Right, so do we have a test for C++ that verifies that.
https://github.com/llvm/llvm-project/pull/84068
More information about the cfe-commits
mailing list