[Concepts] Constraint Enforcement & Diagnostics
authorSaar Raz <saar@raz.email>
Thu, 24 Oct 2019 21:09:37 +0000 (00:09 +0300)
committerSaar Raz <saar@raz.email>
Thu, 24 Oct 2019 21:19:51 +0000 (00:19 +0300)
commitffa214ef22892d75340dc6720271863901dc2c90
tree22ac01e56e625a86277515bd3fd76060016265b8
parenta18818207ab5bb2f81cf1db036d0b23645d5ab83
[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
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]