From f5720175dd17df9a234a2fe73605b031313c6d52 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 23 Jun 2017 14:56:50 -0700 Subject: [PATCH] Map cpp_std c++17/gnu++17 to 1z. C++17 is basically done, but not rubber stamped yet. Rewrite c++17 and gnu++17 to their 1z equivalents until this happens, and we get a version of clang that allows it. Test: mma in a project with cpp_std c++17 Change-Id: I1626c366c3a9b47c997cc27dc9c5205201ebbdf5 --- cc/compiler.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cc/compiler.go b/cc/compiler.go index cec527bf6..f16287803 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -365,11 +365,15 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag cStd = compiler.Properties.C_std } - cppStd := config.CppStdVersion - if compiler.Properties.Cpp_std == "experimental" { + cppStd := compiler.Properties.Cpp_std + switch compiler.Properties.Cpp_std { + case "": + cppStd = config.CppStdVersion + case "experimental": cppStd = config.ExperimentalCppStdVersion - } else if compiler.Properties.Cpp_std != "" { - cppStd = compiler.Properties.Cpp_std + case "c++17", "gnu++17": + // Map c++17 and gnu++17 to their 1z equivalents, until 17 is finalized. + cppStd = strings.Replace(compiler.Properties.Cpp_std, "17", "1z", 1) } if !flags.Clang {