Update cxx standard; Add C++ latest for gcc; Update GCC tests

This commit is contained in:
$continue$ 2020-08-21 21:39:55 +03:00
parent 75c74f2c4a
commit 31707a40c4
4 changed files with 10 additions and 2 deletions

View File

@ -456,7 +456,7 @@
if cfg.cppdialect and cfg.cppdialect ~= "Default" then if cfg.cppdialect and cfg.cppdialect ~= "Default" then
local cppMap = { local cppMap = {
["C++latest"] = "c++17", -- TODO: keep this up to date >_< ["C++latest"] = "c++20",
["C++98"] = "c++98", ["C++98"] = "c++98",
["C++0x"] = "c++11", ["C++0x"] = "c++11",
["C++11"] = "c++11", ["C++11"] = "c++11",

View File

@ -255,7 +255,7 @@
Context = "-checkaction=context", Context = "-checkaction=context",
}, },
cppdialect = { 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++98"] = "-extern-std=c++98",
["C++0x"] = "-extern-std=c++11", ["C++0x"] = "-extern-std=c++11",
["C++11"] = "-extern-std=c++11", ["C++11"] = "-extern-std=c++11",

View File

@ -212,6 +212,7 @@
["gnu++17"] = "-std=gnu++17", ["gnu++17"] = "-std=gnu++17",
["gnu++2a"] = "-std=gnu++2a", ["gnu++2a"] = "-std=gnu++2a",
["gnu++20"] = "-std=gnu++20", ["gnu++20"] = "-std=gnu++20",
["C++latest"] = "-std=c++20",
}, },
rtti = { rtti = {
Off = "-fno-rtti" Off = "-fno-rtti"

View File

@ -830,6 +830,13 @@
test.contains({ }, gcc.getcflags(cfg)) test.contains({ }, gcc.getcflags(cfg))
end 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() function suite.cxxflags_onCppGnu98()
cppdialect "gnu++98" cppdialect "gnu++98"
prepare() prepare()