aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-02-21 08:37:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-02-21 08:37:10 +0200
commit4a47a60f958339d5ccf479481b0d4e998ee0d448 (patch)
tree296c9872f1560369538d62c5394502b03878f165
parentab4bba98251ebb2732ccfd22d7e6a464337f90f4 (diff)
Define __cpp_modules=201810 (merged modules) for MSVC 16.4
-rw-r--r--libbuild2/cxx/init.cxx19
-rw-r--r--tests/cc/modules/modules.testscript2
2 files changed, 12 insertions, 9 deletions
diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx
index 901fd8f..a886cbc 100644
--- a/libbuild2/cxx/init.cxx
+++ b/libbuild2/cxx/init.cxx
@@ -273,18 +273,21 @@ namespace build2
{
case compiler_type::msvc:
{
- // While modules are supported in VC15.0 (19.10), there is a bug
- // in separate interface/implementation unit support which makes
- // them pretty much unusable. This has been fixed in VC15.3
- // (19.11). And VC15.5 (19.12) supports the 'export module M;'
- // syntax.
+ // While modules are supported in VC 15.0 (19.10), there is a
+ // bug in the separate interface/implementation unit support
+ // which makes them pretty much unusable. This has been fixed in
+ // 15.3 (19.11). And 15.5 (19.12) supports the `export module
+ // M;` syntax. And 16.4 (19.24) supports the global module
+ // fragment.
//
if (mj > 19 || (mj == 19 && mi >= (l ? 10 : 12)))
{
r.push_back (
- mj > 19 || mi > 11
- ? "/D__cpp_modules=201704" // p0629r0 (export module M;)
- : "/D__cpp_modules=201703"); // n4647 ( module M;)
+ mj > 19 || mi >= 24 ?
+ "/D__cpp_modules=201810" : // p1103 (merged modules)
+ mj == 19 || mi >= 12 ?
+ "/D__cpp_modules=201704" : // p0629r0 (export module M;)
+ "/D__cpp_modules=201703"); // n4647 ( module M;)
r.push_back ("/experimental:module");
modules = true;
diff --git a/tests/cc/modules/modules.testscript b/tests/cc/modules/modules.testscript
index 5ef032e..4fd9598 100644
--- a/tests/cc/modules/modules.testscript
+++ b/tests/cc/modules/modules.testscript
@@ -206,7 +206,7 @@ cat <<EOI >=g.hxx;
void g ();
EOI
cat <<EOI >=core.mxx;
-#if __cpp_modules >= 201804
+#if __cpp_modules >= 201810
module;
#endif