[clang] [Clang] Add __has_target_builtin macro (PR #126324)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 06:05:44 PST 2025


================
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
                                            diag::err_feature_check_malformed);
         return II && HasExtension(*this, II->getName());
       });
-  } else if (II == Ident__has_builtin) {
+  } else if (II == Ident__has_builtin || II == Ident__has_target_builtin) {
----------------
AaronBallman wrote:

FWIW, I just verified that `II` can't be nullptr here, so we don't have to worry about `Ident__has_target_builtin` matching in that case. Note that non-asserts builds won't catch this failure though and we may get weird behavior as a result if it were to happen somehow.

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


More information about the cfe-commits mailing list