MaskRay added inline comments.
Comment at: clang/test/Driver/x-args.c:1
+// RUN: %clang -fsyntax-only -Werror -xc %s
+// RUN: %clang -fsyntax-only -Werror %s -xc %s
MaskRay wrote:
> The first two RUN lines are unneeded
Sorry, they are needed because of -Werror.
MaskRay added inline comments.
Comment at: clang/lib/Driver/Driver.cpp:2316
+if (LastInputArg->getIndex() < LastXArg->getIndex()) {
+ Diag(clang::diag::warn_drv_unused_x) << LastXArg->getValue();
+}
https://llvm.org/docs/CodingStandards.html#don-t-us
MaskRay added inline comments.
Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:369
+def warn_drv_unused_x : Warning<
+ "‘-x %0’ after last input file has no effect">,
+ InGroup;
Use ASCII punctuation marks
Repository:
rG LLVM Github Monorepo
MaskRay added inline comments.
Comment at: clang/test/Driver/x-args.c:1
+// RUN: %clang -fsyntax-only -Werror -xc %s
+// RUN: %clang -fsyntax-only -Werror %s -xc %s
The first two RUN lines are unneeded
Comment at: clang/test/Driver/x-args.c:8
+
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1c1a4b9556db: [clang][driver] Emit a warning if -xc/-xc++ is
after the last input file (authored by kongyi).
Herald added a project: clang.
Herald ad