[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 25 06:53:27 PDT 2025
================
@@ -98,13 +98,6 @@ namespace std_example {
using c1c2 = C_check<int *>; // expected-error{{constraints not satisfied for class template 'C_check' [with T = int *]}}
}
-// typeid() of an expression becomes potentially evaluated if the expression is
-// of a polymorphic type.
-class X { virtual ~X(); };
-constexpr bool b = requires (X &x) { static_cast<int(*)[(typeid(x), 0)]>(nullptr); };
-// expected-error at -1{{constraint variable 'x' cannot be used in an evaluated context}}
-// expected-note at -2{{'x' declared here}}
-
----------------
cor3ntin wrote:
ditto
https://github.com/llvm/llvm-project/pull/132919
More information about the cfe-commits
mailing list