[clang] [clang] Simplify the overload resolution logic for operator new and new[] (PR #211482)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 18:01:56 PDT 2026


================
@@ -30,6 +30,11 @@ namespace std {
   template <class T> struct inner {};
   template <class T> using type_identity = inner<T>;
   #define TYPE_IDENTITY(T) std::type_identity<T>
+#elif INVALID_TYPE_IDENTITY_VERSION==5 
+template <class T> struct type_identity { // #reentrant_type_identity_decl
+  using type = decltype(new T); // #reentrant_type_identity_type_decl
+};
----------------
ojhunt wrote:

Test case generated by Claude 

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


More information about the cfe-commits mailing list