Things might be confusing for people not familiar with how this option works. Add this warning like GCC.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
50 ms | x64 debian > LLVM.Bindings/Go::go.test |
Event Timeline
clang/lib/Driver/Driver.cpp | ||
---|---|---|
2416 | Could we end up here in clang-cl mode with InputTypeArg pointing to a '/TC' or '/TP' option? (Set near the top of the function.) In that case, emitting a diagnostic that talks about -x would be misleading. What if you initialized InputsBeforeOptX to a sentinel value instead (e.g. SIZE_MAX)? Could the if statement then be simplified to just if (Inputs.size() == InputsBeforeX) ? | |
clang/test/Driver/redundant-args.c | ||
2 | These two lines seem to test pretty different things (and I find the first test a bit confusing). Maybe there's a better test to add the new warning to, or it could go in its own file? |
clang/test/Driver/redundant-args.c | ||
---|---|---|
2 | I second @hans here - this is confusing. I suggest the following: // RUN: %clang -Werror -x c -fsyntax-only %s // RUN: not %clang -Werror %s -x c -fsyntax-only 2>&1 | FileCheck %s Basically:
|
Could we end up here in clang-cl mode with InputTypeArg pointing to a '/TC' or '/TP' option? (Set near the top of the function.) In that case, emitting a diagnostic that talks about -x would be misleading.
What if you initialized InputsBeforeOptX to a sentinel value instead (e.g. SIZE_MAX)? Could the if statement then be simplified to just
?