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

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 06:46:59 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) {
----------------
sarnex wrote:

Yeah I had the same concern originally and came to the same conclusion, but based on other feedback I'm going to make `__has_target_builtin` always defined, so `Ident__has_target_builtin` will never be `nullptr` so non-assert builds won't be weird (at least with this macro)

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


More information about the cfe-commits mailing list