[Concepts] Constraint Enforcement & Diagnostics
authorSaar Raz <saar@raz.email>
Thu, 5 Dec 2019 23:30:21 +0000 (01:30 +0200)
committerSaar Raz <saar@raz.email>
Thu, 5 Dec 2019 23:34:20 +0000 (01:34 +0200)
commitfdf80e86a52849813d05da4b6c25884c06ba9e98
treef08ca57be85567d41a118bedb588a8152763c360
parent7faa8440440f280912c33a27c14c0dc4031532de
[Concepts] Constraint Enforcement & Diagnostics

Part of the C++20 concepts implementation effort.
- Associated constraints (requires clauses, currently) are now enforced when instantiating/specializing templates and when considering partial specializations and function overloads.
- Elaborated diagnostics give helpful insight as to why the constraints were not satisfied.
Phabricator: D41569

Re-commit, after fixing some memory bugs.
23 files changed:
clang/include/clang/AST/ASTConcept.h [new file with mode: 0644]
clang/include/clang/AST/ExprCXX.h
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/include/clang/Sema/TemplateDeduction.h
clang/lib/AST/ASTConcept.cpp [new file with mode: 0644]
clang/lib/AST/ASTContext.cpp
clang/lib/AST/CMakeLists.txt
clang/lib/AST/Decl.cpp
clang/lib/AST/ExprCXX.cpp
clang/lib/Sema/SemaConcept.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriterStmt.cpp
clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
clang/test/CXX/temp/temp.constr/temp.constr.constr/function-templates.cpp [new file with mode: 0644]
clang/test/CXX/temp/temp.constr/temp.constr.constr/non-function-templates.cpp [new file with mode: 0644]
clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp [new file with mode: 0644]