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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 10 06:45:26 PDT 2025


================
@@ -2022,8 +2022,14 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) {
                                                 DeclarationName());
       if (!NewTI || SemaRef.CheckEnumUnderlyingType(NewTI))
         Enum->setIntegerType(SemaRef.Context.IntTy);
-      else
-        Enum->setIntegerTypeSourceInfo(NewTI);
+      else {
+        // If the underlying type is atomic, we need to adjust the type before
+        // continuing. See C23 6.7.3.3p5 and Sema::ActOnTag().
+        if (NewTI->getType()->isAtomicType())
----------------
AaronBallman wrote:

Done!

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


More information about the cfe-commits mailing list