[clang] Use decltype((E)) for compound requirement type constraint
authorMatheus Izvekov <mizvekov@gmail.com>
Mon, 8 Mar 2021 00:09:13 +0000 (01:09 +0100)
committerMatheus Izvekov <mizvekov@gmail.com>
Tue, 30 Mar 2021 20:00:33 +0000 (22:00 +0200)
commit3ad6dd5d8f0a70756f665e8179ad7c5210022c11
tree33efd69744c073eb7d34418ca6de486623bafbef
parent73adc05cedb2da5c0f4b83a26478203937e3f501
[clang] Use decltype((E)) for compound requirement type constraint

See PR45088.

Compound requirement type constraints were using decltype(E) instead of
decltype((E)), as per `[expr.prim.req]p1.3.3`.

Since neither instantiation nor type dependence should matter for
the constraints, this uses an approach where a `decltype` type is not built,
and just the canonical type of the expression after template instantiation
is used on the requirement.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D98160
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaConcept.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CXX/expr/expr.prim/expr.prim.req/compound-requirement.cpp