@@ -405,7 +405,7 @@ namespace {
405405 Opts.FastMath = 1 ;
406406#endif
407407
408- if (CompilerOpts.DefaultLanguage (Opts)) {
408+ if (CompilerOpts.DefaultLanguage (& Opts)) {
409409#ifdef __STRICT_ANSI__
410410 Opts.GNUMode = 0 ;
411411#else
@@ -429,7 +429,7 @@ namespace {
429429 Opts.MicrosoftExt = 0 ;
430430 }
431431
432- if (CompilerOpts.DefaultLanguage (Opts)) {
432+ if (CompilerOpts.DefaultLanguage (& Opts)) {
433433#if _GLIBCXX_USE_FLOAT128
434434 // We are compiling with libstdc++ with __float128 enabled.
435435 if (!Target.hasFloat128Type ()) {
@@ -634,7 +634,7 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
634634 SetPreprocessorFromBinary (PPOpts);
635635
636636 // Sanity check that clang delivered the language standard requested
637- if (CompilerOpts.DefaultLanguage (LangOpts)) {
637+ if (CompilerOpts.DefaultLanguage (& LangOpts)) {
638638 switch (CxxStdCompiledWith ()) {
639639 case 17 : assert (LangOpts.CPlusPlus1z && " Language version mismatch" );
640640 case 14 : assert (LangOpts.CPlusPlus14 && " Language version mismatch" );
@@ -732,18 +732,17 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
732732 // We do C++ by default; append right after argv[0] if no "-x" given
733733 argvCompile.push_back (" -x" );
734734 argvCompile.push_back ( " c++" );
735-
736- if (!COpts.StdVersion ) {
737- // By default, set the standard to what cling was compiled with.
738- // clang::driver::Compilation will do various things while initializing
739- // and by enforcing the std version now cling is telling clang what to
740- // do, rather than after clang has dedcuded a default.
741- switch (CxxStdCompiledWith ()) {
742- case 17 : argvCompile.emplace_back (" -std=c++1z" ); break ;
743- case 14 : argvCompile.emplace_back (" -std=c++14" ); break ;
744- case 11 : argvCompile.emplace_back (" -std=c++11" ); break ;
745- default : llvm_unreachable (" Unrecognized C++ version" );
746- }
735+ }
736+ if (COpts.DefaultLanguage ()) {
737+ // By default, set the standard to what cling was compiled with.
738+ // clang::driver::Compilation will do various things while initializing
739+ // and by enforcing the std version now cling is telling clang what to
740+ // do, rather than after clang has dedcuded a default.
741+ switch (CxxStdCompiledWith ()) {
742+ case 17 : argvCompile.emplace_back (" -std=c++1z" ); break ;
743+ case 14 : argvCompile.emplace_back (" -std=c++14" ); break ;
744+ case 11 : argvCompile.emplace_back (" -std=c++11" ); break ;
745+ default : llvm_unreachable (" Unrecognized C++ version" );
747746 }
748747 }
749748 // argv[0] already inserted, get the rest
0 commit comments