[clang] [C23] Accept an _Atomic underlying type (PR #147802)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 9 11:48:37 PDT 2025
================
@@ -17152,6 +17152,13 @@ bool Sema::CheckEnumUnderlyingType(TypeSourceInfo *TI) {
SourceLocation UnderlyingLoc = TI->getTypeLoc().getBeginLoc();
QualType T = TI->getType();
+ // C++0x 7.2p2: The type-specifier-seq of an enum-base shall name an
+ // integral type; any cv-qualification is ignored.
+ // C23 6.7.3.3p5: The underlying type of the enumeration is the unqualified,
+ // non-atomic version of the type specified by the type specifiers in the
+ // specifier qualifier list.
+ T = T.getAtomicUnqualifiedType();
----------------
erichkeane wrote:
Since we're now stripping qualifications, we should probably make sure that all of the callers of this 'treat' that like underlying.
https://github.com/llvm/llvm-project/pull/147802
More information about the cfe-commits
mailing list