From 31707a40c4345abcbb2957f3f33a733669dca882 Mon Sep 17 00:00:00 2001 From: $continue$ Date: Fri, 21 Aug 2020 21:39:55 +0300 Subject: [PATCH] Update cxx standard; Add C++ latest for gcc; Update GCC tests --- modules/d/actions/vcxproj.lua | 2 +- modules/d/tools/dmd.lua | 2 +- src/tools/gcc.lua | 1 + tests/tools/test_gcc.lua | 7 +++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/d/actions/vcxproj.lua b/modules/d/actions/vcxproj.lua index dbbd4e47..8e22a8e3 100644 --- a/modules/d/actions/vcxproj.lua +++ b/modules/d/actions/vcxproj.lua @@ -456,7 +456,7 @@ if cfg.cppdialect and cfg.cppdialect ~= "Default" then local cppMap = { - ["C++latest"] = "c++17", -- TODO: keep this up to date >_< + ["C++latest"] = "c++20", ["C++98"] = "c++98", ["C++0x"] = "c++11", ["C++11"] = "c++11", diff --git a/modules/d/tools/dmd.lua b/modules/d/tools/dmd.lua index 3401a5c6..19d87458 100644 --- a/modules/d/tools/dmd.lua +++ b/modules/d/tools/dmd.lua @@ -255,7 +255,7 @@ Context = "-checkaction=context", }, cppdialect = { - ["C++latest"] = "-extern-std=c++17", -- TODO: keep this up to date >_< + ["C++latest"] = "-extern-std=c++20", -- TODO: keep this up to date >_< ["C++98"] = "-extern-std=c++98", ["C++0x"] = "-extern-std=c++11", ["C++11"] = "-extern-std=c++11", diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index 0cf7243b..9f183288 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -212,6 +212,7 @@ ["gnu++17"] = "-std=gnu++17", ["gnu++2a"] = "-std=gnu++2a", ["gnu++20"] = "-std=gnu++20", + ["C++latest"] = "-std=c++20", }, rtti = { Off = "-fno-rtti" diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index bef18b01..4a81c42d 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -830,6 +830,13 @@ test.contains({ }, gcc.getcflags(cfg)) end + function suite.cxxflags_onCppLatest() + cppdialect "C++latest" + prepare() + test.contains({ "-std=c++20" }, gcc.getcxxflags(cfg)) + test.contains({ }, gcc.getcflags(cfg)) + end + function suite.cxxflags_onCppGnu98() cppdialect "gnu++98" prepare()