aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-11-09 08:20:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-11-09 08:20:20 +0200
commit2fc58b7bda7f8da672c7bd165f441eef6b260dcf (patch)
treefdf34b6de790045d20de90167c51a5c99a480862 /libbuild2/cxx
parent82621c2eff0fadf5adc72fc7a249ad1c43aa2f3d (diff)
Fix more issues with C++20 named modules support in Clang
Diffstat (limited to 'libbuild2/cxx')
-rw-r--r--libbuild2/cxx/init.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx
index 3023ad5..8948e6a 100644
--- a/libbuild2/cxx/init.cxx
+++ b/libbuild2/cxx/init.cxx
@@ -433,20 +433,15 @@ namespace build2
}
case compiler_type::clang:
{
- // @@ TMP: revise
+ // Things (command line options, semantics) changed quite a bit
+ // around Clang 16 so we don't support anything earlier than
+ // that (it's not practically usable anyway).
//
- // At the time of this writing, support for C++20 modules in
- // Clang is incomplete. And starting with Clang 9 (Apple Clang
- // 11.0.3), they are enabled by default in the C++2a mode which
- // breaks the way we set things up for partial preprocessing;
- // see this post for details:
- //
- // http://lists.llvm.org/pipermail/cfe-dev/2019-October/063637.html
- //
- // As a result, for now, we only enable modules if forced with
- // explicit cxx.features.modules=true.
- //
- // Also see Clang modules support hack in cc::compile.
+ // Clang enable modules by default in c++20 or later but they
+ // don't yet (as of Clang 18) define __cpp_modules. When they
+ // do, we can consider enabling modules by default on our side.
+ // For now, we only enable modules if forced with explicit
+ // cxx.features.modules=true.
//
if (modules.value)
{
@@ -459,7 +454,7 @@ namespace build2
// See https://github.com/llvm/llvm-project/issues/71364
//
- prepend ("-D__cpp_modules=201704"); // p0629r0
+ prepend ("-D__cpp_modules=201907L");
modules = true;
}