aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-22 13:59:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-22 13:59:54 +0200
commitd590c966dbcd6faef64e87ba0fc9b105a310f7df (patch)
tree717219749fc9c79e4012fe1d4bf42d81de5f2066
parent980a58e34364556f64f9703245b43061748f20ad (diff)
Disable Clang C++20 modules support unless explicitly forced
-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");