[clang] [clang]: implement std::meta::is_type (PR #211653)

Nhat Nguyen via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 11:57:04 PDT 2026


================
@@ -25,6 +25,24 @@
 // precxx20-error at -3 {{does not have the constexpr builtin}}
 // c-error at -4 {{does not have the constexpr builtin}}
 
+#if __has_builtin(__builtin_meta_is_type)
+#error has the builtin
+#else
+#error does not have the builtin
+#endif
+// cxx20-cxx26-error at -4 {{has the builtin}}
+// precxx20-error at -3 {{does not have the builtin}}
+// c-error at -4 {{does not have the builtin}}
----------------
changkhothuychung wrote:

it looks like in order to do this we need to add a new enum entry here dedicated for reflection - https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/Builtins.h#L3 

and then have the class `CXXMetaBuiltin` inherit `LangBuiltin` with that flag, for example `LangBuiltin<"REFLECTION_LANG">`, which is only enabled with `-freflection` 

Is this the approach we want to do here? 

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


More information about the cfe-commits mailing list