Skip to content

Commit 11ffb4a

Browse files
committed
Remove quotes from diagnostic template instead of stripping it from the constructed argument
1 parent 637eea7 commit 11ffb4a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def warn_drv_potentially_misspelled_joined_argument : Warning<
313313
"joined argument treated as '%0'; did you mean '%1'?">, InGroup<UnknownArgument>;
314314

315315
def err_drv_too_many_actions: Error<
316-
"only one action option is allowed. Got '%0'">;
316+
"only one action option is allowed. Got %0">;
317317
def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
318318
def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
319319
def err_drv_invalid_value_with_suggestion : Error<

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,7 @@ static bool parseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
605605
}
606606
// The diagnostics engine will add single quotes around the argument to the
607607
// error message. Strip the leading and trailing quote from here.
608-
diags.Report(clang::diag::err_drv_too_many_actions)
609-
<< buf.substr(1, buf.size() - 2);
608+
diags.Report(clang::diag::err_drv_too_many_actions) << buf;
610609
return false;
611610
}
612611

0 commit comments

Comments
 (0)