Skip to content

Commit 2ed37a1

Browse files
committed
Configure C++ language standard in goto-cl
1 parent 6d5e446 commit 2ed37a1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/goto-cc/ms_cl_cmdline.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ const char *ms_cl_prefixes[]=
406406
"MT", // link with LIBCMT.LIB
407407
"MDd", // link with MSVCRTD.LIB debug lib
408408
"MTd", // link with LIBCMTD.LIB debug lib
409+
"std:", // specify C++ language standard
409410
nullptr
410411
};
411412

src/goto-cc/ms_cl_mode.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ int ms_cl_modet::doit()
7777
else
7878
compiler.mode=compilet::COMPILE_LINK_EXECUTABLE;
7979

80+
if(cmdline.isset("std:"))
81+
{
82+
const std::string std_string = cmdline.get_value("std:");
83+
84+
if(
85+
std_string == "c++14" || std_string == "c++17" ||
86+
std_string == "c++latest")
87+
{
88+
// we don't have any newer version at the moment
89+
config.cpp.set_cpp14();
90+
}
91+
else
92+
warning() << "unknown language standard " << std_string << eom;
93+
}
94+
else
95+
config.cpp.set_cpp14();
96+
8097
compiler.echo_file_name=true;
8198

8299
if(cmdline.isset("Fo"))

0 commit comments

Comments
 (0)