[clang] Fix erroneous warning. (PR #79821)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 14:52:38 PST 2024


================
@@ -44,3 +47,4 @@
 // CHECK-NOT: -complex-range=fortran
 // WARN1: warning: overriding '-fcx-limited-range' option with '-fcx-fortran-rules' [-Woverriding-option]
 // WARN2: warning: overriding '-fcx-fortran-rules' option with '-fcx-limited-range' [-Woverriding-option]
+// range-no-diagnostics
----------------
MaskRay wrote:

`-verify` does not work for driver errors/warnings. You can add `-Werror`.  In case of errors, `clang -###` will exit with code 1. Since lit requires that commands exit with code 0, `-### -Werror` alone serves as a test.

```
% clang -### -c -fcx-fortran-rules a.c -Werror
...
clang: error: overriding '' option with '-fcx-fortran-rules' [-Werror,-Woverriding-option]
...
```

https://github.com/llvm/llvm-project/pull/79821


More information about the cfe-commits mailing list