[SemaCXX] Set promotion type for enum if its type is promotable to integer type even...
authorZequan Wu <zequanwu@google.com>
Wed, 20 Jul 2022 23:08:25 +0000 (16:08 -0700)
committerZequan Wu <zequanwu@google.com>
Thu, 21 Jul 2022 18:23:21 +0000 (11:23 -0700)
commitd870a575631d2cedab2ff237af8edd17916edc64
tree32e3cdc10e02f0daae46b10491683419e25b38c8
parentbb5dc2918f6010b0393a0b089166f668436f4275
[SemaCXX] Set promotion type for enum if its type is promotable to integer type even if it has no definition.

EnumDecl's promotion type is set either to the parsed type or calculated type
after completing its definition. When it's bool type and has no definition,
its promotion type is bool which is not allowed by clang.

Fixes #56560.

Differential Revision: https://reviews.llvm.org/D130210
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaDecl.cpp
clang/test/CXX/conv/conv.prom/p4.cpp