[libcxx-commits] [libcxx] [libc++][type_traits] Implements "A type trait to detect reference binding to temporary" (PR #128649)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 25 23:55:45 PST 2025


================
@@ -0,0 +1,124 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++23
+
+// These compilers don't support std::reference_converts_from_temporary yet.
+// UNSUPPORTED: android, apple-clang-15, apple-clang-16.1, apple-clang-16.2, clang-19
----------------
frederick-vs-ja wrote:

Maybe we should use `__has_builtin(__reference_converts_from_temporary) || (defined(_LIBCPP_COMPILER_CLANG_BASED) && __clang__ >= 19)` (or `18` for `__reference_constructs_from_temporary`). I'm not sure how to handle Apple Clang, though.

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


More information about the libcxx-commits mailing list