[clang] [C23] Accept an _Atomic underlying type (PR #147802)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 9 12:02:23 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();
+
----------------
AaronBallman wrote:

Good call!

https://github.com/llvm/llvm-project/pull/147802


More information about the cfe-commits mailing list