[clang] Add fine-grained `__has_feature()` cutout (PR #170822)
Florian Mayer via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 8 16:56:10 PST 2025
================
@@ -736,6 +743,22 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
// -f(-no)sanitize=leak should change whether leak detection is enabled by
// default in ASan?
+ // Error if a non-UBSan sanitizer is passed to
+ // `-fsanitize-ignore-for-ubsan-feature=`.
+ //
+ // `shift` is a `SANITIZER_GROUP()`, and so is expanded into its constituents
+ // by `expandSanitizerGroups()` above, though the physical bit is not included
+ // in `SanitizerKind::Undefined`.
+ const SanitizerMask not_ubsan_mask =
+ IgnoreForUbsanFeature &
+ ~(SanitizerKind::Undefined | SanitizerKind::ShiftGroup);
----------------
fmayer wrote:
hmmm. not sure this gymnastics are worth if for the warning
https://github.com/llvm/llvm-project/pull/170822
More information about the cfe-commits
mailing list