File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -5365,11 +5365,11 @@ void Driver::BuildJobs(Compilation &C) const {
53655365 });
53665366 }
53675367
5368- // If the user passed -Qunused-arguments or there were errors, don't warn
5369- // about any unused arguments.
5370- if (Diags. hasErrorOccurred () ||
5371- C. getArgs (). hasArg (options::OPT_Qunused_arguments))
5372- return ;
5368+ // If the user passed -Qunused-arguments or there were errors, don't
5369+ // warn about any unused arguments.
5370+ bool ReportUnusedArguments =
5371+ !Diags. hasErrorOccurred () &&
5372+ !C. getArgs (). hasArg (options::OPT_Qunused_arguments) ;
53735373
53745374 // Claim -fdriver-only here.
53755375 (void )C.getArgs ().hasArg (options::OPT_fdriver_only);
@@ -5423,7 +5423,7 @@ void Driver::BuildJobs(Compilation &C) const {
54235423 !C.getActions ().empty ()) {
54245424 Diag (diag::err_drv_unsupported_opt_for_target)
54255425 << A->getSpelling () << getTargetTriple ();
5426- } else {
5426+ } else if (ReportUnusedArguments) {
54275427 Diag (clang::diag::warn_drv_unused_argument)
54285428 << A->getAsString (C.getArgs ());
54295429 }
Original file line number Diff line number Diff line change 2727// RUN: not %clang --target=x86_64 -### -mhtm -lc %s 2>&1 \
2828// RUN: | FileCheck %s -check-prefix=UNSUP_OPT
2929// UNSUP_OPT: error: unsupported option
30+
31+
32+ // RUN: not %clang -c -Qunused-arguments --target=aarch64-- -mfpu=crypto-neon-fp-armv8 %s 2>&1 \
33+ // RUN: | FileCheck %s --check-prefix=QUNUSED_ARGUMENTS
34+ // QUNUSED_ARGUMENTS: error: unsupported option '-mfpu=' for target 'aarch64--'
You can’t perform that action at this time.
0 commit comments