[all-commits] [llvm/llvm-project] a2246e: [C23] Accept an _Atomic underlying type (#147802)

Aaron Ballman via All-commits all-commits at lists.llvm.org
Fri Jul 11 04:28:25 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2246eebcae47c5cb92c524ee96191edb358922d
      https://github.com/llvm/llvm-project/commit/a2246eebcae47c5cb92c524ee96191edb358922d
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/C/C23/n3030.c
    A clang/test/C/C23/n3030_1.c
    M clang/test/CXX/dcl.dcl/dcl.enum/p2.cpp
    A clang/test/CodeGen/enum3.c
    M clang/test/SemaCXX/enum-scoped.cpp

  Log Message:
  -----------
  [C23] Accept an _Atomic underlying type (#147802)

The underlying type of an enumeration is the non-atomic, unqualified
version of the specified type. Clang was rejecting such enumerations,
with a hard error, but now has the ability to downgrade the error into a
warning. Additionally, we diagnose (as a warning) dropping other
qualifiers. _Atomic is special given that an atomic type need not have
the same size as its non-atomic counterpart, and that the C++ version
of <stdatomic.h> defines _Atomic to std::atomic for easing cross-
language atomic use and std::atomic is an invalid enum base in C++.
(Note: we expose _Atomic in C++ even without including
<stdatomic,h>.)

Fixes #147736



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list