diff options
-rw-r--r-- | include/clang/Basic/DiagnosticDriverKinds.td | 5 | ||||
-rw-r--r-- | lib/Driver/ToolChains/Clang.cpp | 7 | ||||
-rw-r--r-- | lib/Driver/ToolChains/MSVC.cpp | 6 | ||||
-rw-r--r-- | test/Driver/cl-options.c | 2 |
4 files changed, 9 insertions, 11 deletions
diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index 357b739d4c..5d4a2264e7 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -161,9 +161,8 @@ def warn_drv_yc_multiple_inputs_clang_cl : Warning< "support for '/Yc' with more than one source file not implemented yet; flag ignored">, InGroup<ClangClPch>; -def warn_drv_non_fallback_argument_clang_cl : Warning< - "option '%0' is ignored when /fallback happens">, - InGroup<OptionIgnored>; +def err_drv_dllexport_inlines_and_fallback : Error< + "option '/Zc:dllexportInlines-' is ABI-changing and not compatible with '/fallback'">; def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">; def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index c35f7a9405..8de20f6e2e 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -5502,8 +5502,13 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType, if (Args.hasFlag(options::OPT__SLASH_Zc_dllexportInlines_, options::OPT__SLASH_Zc_dllexportInlines, - false)) + false)) { + if (Args.hasArg(options::OPT__SLASH_fallback)) { + D.Diag(clang::diag::err_drv_dllexport_inlines_and_fallback); + } else { CmdArgs.push_back("-fno-dllexport-inlines"); + } + } Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg); Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb); diff --git a/lib/Driver/ToolChains/MSVC.cpp b/lib/Driver/ToolChains/MSVC.cpp index ac68db602f..839f313623 100644 --- a/lib/Driver/ToolChains/MSVC.cpp +++ b/lib/Driver/ToolChains/MSVC.cpp @@ -669,12 +669,6 @@ std::unique_ptr<Command> visualstudio::Compiler::GetCommand( // them too. Args.AddAllArgs(CmdArgs, options::OPT_UNKNOWN); - // Warning for ignored flag. - if (const Arg *dllexportInlines = - Args.getLastArg(options::OPT__SLASH_Zc_dllexportInlines_)) - C.getDriver().Diag(clang::diag::warn_drv_non_fallback_argument_clang_cl) - << dllexportInlines->getAsString(Args); - // Input filename. assert(Inputs.size() == 1); const InputInfo &II = Inputs[0]; diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index 1240943172..f5171d5c04 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -495,7 +495,7 @@ // RUN: %clang_cl /Zc:dllexportInlines /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlines %s // DllExportInlines-NOT: "-fno-dllexport-inlines" // RUN: %clang_cl /fallback /Zc:dllexportInlines- /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlinesFallback %s -// DllExportInlinesFallback: warning: option '/Zc:dllexportInlines-' is ignored when /fallback happens [-Woption-ignored] +// DllExportInlinesFallback: error: option '/Zc:dllexportInlines-' is ABI-changing and not compatible with '/fallback' // RUN: %clang_cl /Zi /c -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s // Zi: "-gcodeview" |