aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTCommon.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2022-10-20 11:55:01 -0700
committerErich Keane <erich.keane@intel.com>2022-10-24 06:32:18 -0700
commitb7c922607c5ba93db8b893d4ba461052af8317b5 (patch)
tree872159c338f6f5c014f5321d9b5231e534f528d2 /clang/lib/Serialization/ASTCommon.cpp
parentd84e4f0829c495452c7ac9f4a7725bde25653dde (diff)
downloadllvm-b7c922607c5ba93db8b893d4ba461052af8317b5.zip
llvm-b7c922607c5ba93db8b893d4ba461052af8317b5.tar.gz
llvm-b7c922607c5ba93db8b893d4ba461052af8317b5.tar.bz2
GH58368: Correct concept checking in a lambda defined in concept
As that bug reports, the problem here is that the lambda's 'context-decl' was not set to the concept, and the lambda picked up template arguments from the concept. SO, we failed to get the correct template arguments in SemaTemplateInstantiate. However, a Concept Specialization is NOT a decl, its an expression, so we weren't able to put the concept in the decl tree like we needed. This patch introduces a ConceptSpecializationDecl, which is the smallest type possible to use for this purpose, containing only the template arguments. The net memory impliciation of this is turning a trailing-objects into a pointer to a type with trailing-objects, so it should be minor. As future work, we may consider giving this type more responsibility, or figuring out how to better merge duplicates, but as this is just a template-argument collection at the moment, there isn't much value to it. Differential Revision: https://reviews.llvm.org/D136451
Diffstat (limited to 'clang/lib/Serialization/ASTCommon.cpp')
-rw-r--r--clang/lib/Serialization/ASTCommon.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTCommon.cpp b/clang/lib/Serialization/ASTCommon.cpp
index 53e4c88..152037d 100644
--- a/clang/lib/Serialization/ASTCommon.cpp
+++ b/clang/lib/Serialization/ASTCommon.cpp
@@ -430,6 +430,7 @@ bool serialization::isRedeclarableDeclKind(unsigned Kind) {
case Decl::Decomposition:
case Decl::Binding:
case Decl::Concept:
+ case Decl::ImplicitConceptSpecialization:
case Decl::LifetimeExtendedTemporary:
case Decl::RequiresExprBody:
case Decl::UnresolvedUsingIfExists: