================ @@ -0,0 +1,431 @@ +// RUN: %clang_cc1 -std=c++20 -Wno-unused %s -verify=expected,cxx20 -Wno-vla-cxx-extension +// RUN: %clang_cc1 -std=c++23 -Wno-unused %s -verify=expected,sincecxx23 -Wno-vla-cxx-extension +// RUN: %clang_cc1 -std=c++26 -Wno-unused %s -verify=expected,sincecxx23 -Wno-vla-cxx-extension +// RUN: %clang_cc1 -std=c++26 -DINLINE_NAMESPACE -Wno-unused %s -verify=expected,sincecxx23 -Wno-vla-cxx-extension + +inline constexpr void* operator new(__SIZE_TYPE__, void* p) noexcept { return p; } +namespace std { +template<typename T, typename... Args> +constexpr T* construct_at(T* p, Args&&... args) { return ::new((void*)p) T(static_cast<Args&&>(args)...); } +template<typename T> +constexpr void destroy_at(T* p) { p->~T(); } +template<typename T> +struct allocator { + constexpr T* allocate(__SIZE_TYPE__ n) { return static_cast<T*>(::operator new(n * sizeof(T))); } + constexpr void deallocate(T* p, __SIZE_TYPE__) { ::operator delete(p); } +}; +using nullptr_t = decltype(nullptr); +template<typename T, T v> +struct integral_constant { static constexpr T value = v; }; +template<bool v> +using bool_constant = integral_constant<bool, v>; +using true_type = bool_constant<true>; +using false_type = bool_constant<false>; +template<typename T> +inline constexpr bool is_function_v = __is_function(T); +#ifdef INLINE_NAMESPACE ---------------- MitalAshok wrote:
The diagnostic message goes from `'__builtin_is_within_lifetime'` -> `'std::is_within_lifetime'` if the builtin is called from `std::is_within_lifetime` ([See the last few tests in this file](https://github.com/llvm/llvm-project/blob/70fc7075f820ab001a221a60c3574c0bf91cafdc/clang/test/SemaCXX/builtin-is-within-lifetime.cpp#L409-L431)), and I'm checking that still works if the function is declared in an inline namespace (and libc++ might put it in an inline versioning namespace) https://github.com/llvm/llvm-project/pull/91895 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits