[clang] [WIP][DO NOT MERGE][Clang][Driver] Emit warning when -fsanitize-trap=<...> is passed without associated -fsanitize=<...> (PR #147997)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 11 07:39:49 PDT 2025


================
@@ -874,4 +874,9 @@ def warn_drv_openacc_without_cir
     : Warning<"OpenACC directives will result in no runtime behavior; use "
               "-fclangir to enable runtime effect">,
       InGroup<SourceUsesOpenACC>;
+
+def warn_drv_sanitize_trap_mismatch : Warning<
+  "-fsanitize-trap=%0 has no effect because the matching sanitizer is not enabled; "
+  "did you mean to pass \"-fsanitize=%0\" as well?">,
----------------
delcypher wrote:

Nit: Here's my suggested wording.

`"-fsanitize-trap=%0 has no effect because the "%0" sanitizer is disabled; consider passing \"`-fsantize=%0\"` to enable the sanitizer`

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


More information about the cfe-commits mailing list