aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cxx/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-05 08:29:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-05 08:29:23 +0200
commitd48027b835e19c97ad6af8721bd8643c8c180acf (patch)
treeb01c3f72270b8d1229637ba08685363681b9a270 /libbuild2/cxx/init.cxx
parentee9783367a1e933b9af49a89a4fb8e0a027bcf5d (diff)
Recognize latest C (2x) and C++ (2b) standards
Diffstat (limited to 'libbuild2/cxx/init.cxx')
-rw-r--r--libbuild2/cxx/init.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx
index 4f2b5eb..851ea0c 100644
--- a/libbuild2/cxx/init.cxx
+++ b/libbuild2/cxx/init.cxx
@@ -225,18 +225,19 @@ namespace build2
;
else
{
- // Translate 11 to 0x, 14 to 1y, 17 to 1z, and 20 to 2a for
- // compatibility with older versions of the compilers.
+ // Translate 11 to 0x, 14 to 1y, 17 to 1z, 20 to 2a, and 23 to 2b
+ // for compatibility with older versions of the compilers.
//
o = "-std=";
- if (*v == "98") o += "c++98";
- else if (*v == "03") o += "c++03";
- else if (*v == "11") o += "c++0x";
- else if (*v == "14") o += "c++1y";
- else if (*v == "17") o += "c++1z";
+ if (*v == "23") o += "c++2b";
else if (*v == "20") o += "c++2a";
- else o += *v; // In case the user specifies e.g., 'gnu++17'.
+ else if (*v == "17") o += "c++1z";
+ else if (*v == "14") o += "c++1y";
+ else if (*v == "11") o += "c++0x";
+ else if (*v == "03") o += "c++03";
+ else if (*v == "98") o += "c++98";
+ else o += *v; // In case the user specifies `gnu++NN` or some such.
}
if (!o.empty ())