aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/cxx/init.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx
index 866ec12..49ed076 100644
--- a/libbuild2/cxx/init.cxx
+++ b/libbuild2/cxx/init.cxx
@@ -335,14 +335,20 @@ namespace build2
}
case compiler_type::clang:
{
- // Enable starting with Clang 6.0.0.
+ // 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:
//
- // Also see Clang modules support hack in cc::compile.
+ // 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.
//
- // @@ Clang 9 enables modules by default in C++2a. We should
- // probably reflect this in the modules value.
+ // Also see Clang modules support hack in cc::compile.
//
- if (mj >= 6)
+ if (l)
{
r.push_back ("-D__cpp_modules=201704"); // p0629r0
r.push_back ("-fmodules-ts");