[Concepts] Check function constraints before deducing auto return type
authorSaar Raz <saar@raz.email>
Fri, 31 Jan 2020 01:37:46 +0000 (03:37 +0200)
committerSaar Raz <saar@raz.email>
Fri, 31 Jan 2020 01:51:26 +0000 (03:51 +0200)
commit980517b3530ffb7faa1a23fdc007d78f5b45ae3c
tree15d52e8919f6dc3db82a37cba0abaa7e7c7e1e38
parent5ae6554a1dcd2e39346030c06d364492901c9e8d
[Concepts] Check function constraints before deducing auto return type

A constrained function with an auto return type would have it's definition
instantiated in order to deduce the auto return type before the constraints
are checked.

Move the constraints check after the return type deduction.
clang/lib/Sema/SemaExpr.cpp
clang/test/CXX/expr/expr.prim/expr.prim.id/p4.cpp