Merge pull request #1503 from continue98/cppdialect-update

Update cxx standard;
This commit is contained in:
Samuel Surtees 2020-08-22 13:54:47 +10:00 committed by GitHub
commit 55b714d9a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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"

View File

@ -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()