aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-02 14:17:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-02 14:17:40 +0200
commitd5ad01a48ac4c7c69995a58a3c198630df904419 (patch)
tree53560955ad0bdc7a198cd7dc324963bb848d1cf2
parentb399d1eb4965e658e5abdaf33ec844d3c15cbc5d (diff)
Add support for C++20/c++2a modes
Note: not yet enabled for GCC 8 since the patch is not yet merged.
-rw-r--r--build2/cxx/init.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx
index e2165a6..7f099cf 100644
--- a/build2/cxx/init.cxx
+++ b/build2/cxx/init.cxx
@@ -81,6 +81,7 @@ namespace build2
}
case compiler_id::gcc:
{
+ //if (mj >= 8) o = "-std=c++2a"; // 20
if (mj >= 5) o = "-std=c++1z"; // 17
else if (mj == 4 && mi >= 8) o = "-std=c++1y"; // 14
else if (mj == 4 && mi >= 4) o = "-std=c++0x"; // 11
@@ -105,7 +106,8 @@ namespace build2
else {mj = 3; mi = 0;}
}
- if (mj > 3 || (mj == 3 && mi >= 5)) o = "-std=c++1z"; // 17
+ if (mj >= 5) o = "-std=c++2a"; // 20
+ else if (mj > 3 || (mj == 3 && mi >= 5)) o = "-std=c++1z"; // 17
else if (mj == 3 && mi >= 4) o = "-std=c++1y"; // 14
else /* ??? */ o = "-std=c++0x"; // 11
@@ -253,8 +255,8 @@ namespace build2
case compiler_id::clang:
case compiler_id::icc:
{
- // Translate 11 to 0x, 14 to 1y, and 17 to 1z for compatibility
- // with older versions of the compilers.
+ // Translate 11 to 0x, 14 to 1y, 17 to 1z, and 20 to 2a for
+ // compatibility with older versions of the compilers.
//
if (v == nullptr)
;
@@ -267,6 +269,7 @@ namespace build2
else if (*v == "11") o += "c++0x";
else if (*v == "14") o += "c++1y";
else if (*v == "17") o += "c++1z";
+ else if (*v == "20") o += "c++2a";
else o += *v; // In case the user specifies e.g., 'gnu++17'.
r.push_back (move (o));