// RUN: %clang_cc1 -std=c++20 -verify %s // expected-no-diagnostics namespace P1937R2 { struct N { constexpr N() {} N(N const&) = delete; }; template constexpr void bad_assert_copyable() { T t; T t2 = t; } using ineffective = decltype(bad_assert_copyable()); template consteval void assert_copyable() { T t; T t2 = t; } // Prior to P1937R2 consteval functions were evaluated even in otherwise // unevaluated context, now this is well-formed. using check = decltype(assert_copyable()); template __add_rvalue_reference(T) declval(); constexpr auto add1(auto lhs, auto rhs) { return lhs + rhs; } using T = decltype(add1(declval(), declval())); consteval auto add2(auto lhs, auto rhs) { return lhs + rhs; } using T = decltype(add2(declval(), declval())); } // namespace P1937R2