[PATCH] D159018: [clang][modules] Add a c23 module feature

Ian Anderson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 28 14:36:27 PDT 2023


iana created this revision.
iana added reviewers: ChuanqiXu, Bigcheese, v.g.vassilev, aaron.ballman.
Herald added a subscriber: ributzka.
Herald added a project: All.
iana requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Add a c23 module feature for `requires`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159018

Files:
  clang/docs/Modules.rst
  clang/docs/ReleaseNotes.rst
  clang/lib/Basic/Module.cpp
  clang/test/Modules/Inputs/DependsOnModule.framework/module.map
  clang/test/Modules/requires.m


Index: clang/test/Modules/requires.m
===================================================================
--- clang/test/Modules/requires.m
+++ clang/test/Modules/requires.m
@@ -36,3 +36,6 @@
 // expected-error at DependsOnModule.framework/module.map:64 {{module 'DependsOnModule.C17' requires feature 'c17'}}
 @import DependsOnModule.C17; // expected-note {{module imported here}}
 #endif
+// expected-error at DependsOnModule.framework/module.map:67 {{module 'DependsOnModule.C23' requires feature 'c23'}}
+ at import DependsOnModule.C23; // expected-note {{module imported here}}
+#endif
Index: clang/test/Modules/Inputs/DependsOnModule.framework/module.map
===================================================================
--- clang/test/Modules/Inputs/DependsOnModule.framework/module.map
+++ clang/test/Modules/Inputs/DependsOnModule.framework/module.map
@@ -64,4 +64,7 @@
   explicit module C17 {
     requires c17
   }
+  explicit module C23 {
+    requires c23
+  }
 }
Index: clang/lib/Basic/Module.cpp
===================================================================
--- clang/lib/Basic/Module.cpp
+++ 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)
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ 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
 -------------------------------------------------
Index: clang/docs/Modules.rst
===================================================================
--- clang/docs/Modules.rst
+++ clang/docs/Modules.rst
@@ -588,6 +588,9 @@
 c17
   C17 support is available.
 
+c23
+  C23 support is available.
+
 freestanding
   A freestanding environment is available.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159018.554050.patch
Type: text/x-patch
Size: 2417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230828/dff6a77a/attachment.bin>


More information about the cfe-commits mailing list