[PATCH] D124726: Suggest typoed directives in preprocessor conditionals

Ken Matsui via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 30 20:50:39 PDT 2022


ken-matsui added inline comments.


================
Comment at: clang/test/OpenMP/predefined_macro.c:7
 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify -o - %s
-// expected-no-diagnostics
+// expected-warning at +5 {{'#elsif' directive not found, did you mean '#elif'?}}
 #ifdef FOPENMP
----------------
I am not sure if this typo was intended.

When I renamed `elsif` to `elif`, `#error "_OPENMP has incorrect value"` on line `13` was evaluated.

Therefore, if this typo was intended, just suppressing the warning with `expected-warning` would be better. However, if this typo was NOT intended, I think I should make `_OPENMP` equal to `201107`. It is also possible that this test was mistakenly written.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124726/new/

https://reviews.llvm.org/D124726



More information about the cfe-commits mailing list