diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst --- a/clang/docs/Modules.rst +++ b/clang/docs/Modules.rst @@ -588,6 +588,9 @@ c17 C17 support is available. +c23 + C23 support is available. + freestanding A freestanding environment is available. diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -107,6 +107,7 @@ and the ``__STDC_VERSION__`` macro now expands to ``202311L`` instead of its previous placeholder value. Clang continues to accept ``-std=c2x`` and ``-std=gnu2x`` as aliases for C23 and GNU C23, respectively. +- Clang now supports `requires c23` for module maps. Non-comprehensive list of changes in this release ------------------------------------------------- diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -113,6 +113,7 @@ .Case("c99", LangOpts.C99) .Case("c11", LangOpts.C11) .Case("c17", LangOpts.C17) + .Case("c23", LangOpts.C23) .Case("freestanding", LangOpts.Freestanding) .Case("gnuinlineasm", LangOpts.GNUAsm) .Case("objc", LangOpts.ObjC) diff --git a/clang/test/Modules/Inputs/DependsOnModule.framework/module.map b/clang/test/Modules/Inputs/DependsOnModule.framework/module.map --- a/clang/test/Modules/Inputs/DependsOnModule.framework/module.map +++ b/clang/test/Modules/Inputs/DependsOnModule.framework/module.map @@ -64,4 +64,7 @@ explicit module C17 { requires c17 } + explicit module C23 { + requires c23 + } } diff --git a/clang/test/Modules/requires.m b/clang/test/Modules/requires.m --- a/clang/test/Modules/requires.m +++ b/clang/test/Modules/requires.m @@ -35,4 +35,6 @@ @import DependsOnModule.C11; // expected-note {{module imported here}} // expected-error@DependsOnModule.framework/module.map:64 {{module 'DependsOnModule.C17' requires feature 'c17'}} @import DependsOnModule.C17; // expected-note {{module imported here}} +// expected-error@DependsOnModule.framework/module.map:67 {{module 'DependsOnModule.C23' requires feature 'c23'}} +@import DependsOnModule.C23; // expected-note {{module imported here}} #endif