From ca4f43374643f3e1f16c7cb8d259e98311579e42 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 9 Feb 2015 17:01:39 +0200 Subject: Make c++14 valid value for --std --- odb/cxx-lexer.cxx | 2 +- odb/odb.cxx | 5 +++++ odb/option-types.cxx | 3 +++ odb/option-types.hxx | 3 ++- odb/options.cli | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) (limited to 'odb') diff --git a/odb/cxx-lexer.cxx b/odb/cxx-lexer.cxx index fea05d7..7029c7e 100644 --- a/odb/cxx-lexer.cxx +++ b/odb/cxx-lexer.cxx @@ -194,7 +194,7 @@ cxx_string_lexer () linemap_add (&line_map_, LC_ENTER, 0, "", 0); reader_ = cpp_create_reader ( - cxx_dialect == cxx0x + cxx_dialect == cxx0x // Nothing new for C++14. #if BUILDING_GCC_MAJOR > 4 || BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR > 6 ? CLK_CXX11 #else diff --git a/odb/odb.cxx b/odb/odb.cxx index c56e3ef..af60299 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -613,6 +613,11 @@ main (int argc, char* argv[]) args[3] = "-std=gnu++0x"; // gnu++11 was only added in GCC 4.7.0. break; } + case cxx_version::cxx14: + { + args[3] = "-std=gnu++14"; + break; + } } } diff --git a/odb/option-types.cxx b/odb/option-types.cxx index e003381..d7c2621 100644 --- a/odb/option-types.cxx +++ b/odb/option-types.cxx @@ -18,6 +18,7 @@ static const char* cxx_version_[] = { "c++98", "c++11" + "c++14" }; string cxx_version:: @@ -38,6 +39,8 @@ operator>> (istream& is, cxx_version& v) v = cxx_version::cxx98; else if (s == "c++11") v = cxx_version::cxx11; + else if (s == "c++14") + v = cxx_version::cxx14; else is.setstate (istream::failbit); } diff --git a/odb/option-types.hxx b/odb/option-types.hxx index ea2fae9..e320598 100644 --- a/odb/option-types.hxx +++ b/odb/option-types.hxx @@ -21,7 +21,8 @@ struct cxx_version enum value { cxx98, - cxx11 + cxx11, + cxx14 }; cxx_version (value v = value (0)) : v_ (v) {} diff --git a/odb/options.cli b/odb/options.cli index a65f9ba..cf278cb 100644 --- a/odb/options.cli +++ b/odb/options.cli @@ -311,7 +311,7 @@ class options { "", "Specify the C++ standard that should be used during compilation. - Valid values are \cb{c++98} (default) and \cb{c++11}." + Valid values are \cb{c++98} (default), \cb{c++11}, and \cb{c++14}." }; // Diagnostics. -- cgit v1.1