[clang] fix crash on template instantiation of invalid requires expressions
authorMatheus Izvekov <mizvekov@gmail.com>
Tue, 3 Aug 2021 20:10:34 +0000 (22:10 +0200)
committerMatheus Izvekov <mizvekov@gmail.com>
Tue, 3 Aug 2021 21:16:04 +0000 (23:16 +0200)
commite64e6924b8aef8d48117beb6e87162109ac2512c
treec24fb31816dcfe6c5d127bf086ecf7a7dbf2920d
parent63a5ac4e0d969f41bf71785cc3979349a45a2892
[clang] fix crash on template instantiation of invalid requires expressions

See PR48656.

The implementation of the template instantiation of requires expressions
was incorrectly trying to get the expression from an 'ExprRequirement'
before checking if it was an error state.

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

Differential Revision: https://reviews.llvm.org/D107399
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp
clang/test/CXX/temp/temp.constr/temp.constr.normal/p1.cpp