[clang] [Clang] prevent null explicit object argument from being deduced (PR #104328)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 15:54:51 PDT 2024


================
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++2b -verify %s
+
+namespace std {
+struct rv {};
+
+template <bool B, typename T> struct enable_if;
+template <typename T> struct enable_if<true, T> { typedef T type; };
+
+template <typename U, typename T>
+typename enable_if<__is_convertible(T, rv), U>::type forward(T &);
+template <typename U, typename T>
+typename enable_if<!__is_convertible(T, rv), U &>::type forward(T &);
+}
----------------
cor3ntin wrote:

You can get rid of all of that

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


More information about the cfe-commits mailing list