aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 9bccb7e..4fb1eb8 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -610,14 +610,17 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
// TODO: Currently throws a Diagnostic for anything other than -W<error>,
// this has to change when other -W<opt>'s are supported.
if (args.hasArg(clang::driver::options::OPT_W_Joined)) {
- if (args.getLastArgValue(clang::driver::options::OPT_W_Joined)
- .equals("error")) {
- res.setWarnAsErr(true);
- } else {
- const unsigned diagID =
- diags.getCustomDiagID(clang::DiagnosticsEngine::Error,
- "Only `-Werror` is supported currently.");
- diags.Report(diagID);
+ const auto &wArgs =
+ args.getAllArgValues(clang::driver::options::OPT_W_Joined);
+ for (const auto &wArg : wArgs) {
+ if (wArg == "error") {
+ res.setWarnAsErr(true);
+ } else {
+ const unsigned diagID =
+ diags.getCustomDiagID(clang::DiagnosticsEngine::Error,
+ "Only `-Werror` is supported currently.");
+ diags.Report(diagID);
+ }
}
}