Skip to content

Commit e6c2227

Browse files
committed
Fix alias-template-with-lambdas.cpp
1 parent d256511 commit e6c2227

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

clang/include/clang/Sema/Template.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ enum class TemplateSubstitutionKind : char {
261261
// ==
262262
// AssociatedDecl) &&
263263
// "Trying to change incorrect declaration?");
264-
TemplateArgumentLists.back().AssociatedDeclAndFinal.setPointer(AssociatedDecl);
264+
TemplateArgumentLists.back().AssociatedDeclAndFinal.setPointer(
265+
AssociatedDecl);
265266
TemplateArgumentLists.back().Args = Args;
266267
}
267268

clang/lib/Sema/SemaConcept.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ static bool calculateConstraintSatisfaction(
593593

594594
Sema::SFINAETrap Trap(S);
595595
Sema::ArgPackSubstIndexRAII SubstIndex(
596-
S, Constraint.getPackSubstitutionIndex());
596+
S, Constraint.getPackSubstitutionIndex()
597+
? Constraint.getPackSubstitutionIndex()
598+
: PackSubstitutionIndex);
597599

598600
const ASTTemplateArgumentListInfo *Ori =
599601
Constraint.getConceptId()->getTemplateArgsAsWritten();
@@ -1750,9 +1752,8 @@ NormalizedConstraint *NormalizedConstraint::fromConstraintExpr(
17501752
if (substituteParameterMappings(S, *SubNF, CSE))
17511753
return nullptr;
17521754

1753-
return ConceptIdConstraint::Create(S.getASTContext(),
1754-
CSE->getConceptReference(), SubNF, D,
1755-
SubstIndex);
1755+
return ConceptIdConstraint::Create(
1756+
S.getASTContext(), CSE->getConceptReference(), SubNF, D, SubstIndex);
17561757

17571758
} else if (auto *FE = dyn_cast<const CXXFoldExpr>(E);
17581759
FE && S.getLangOpts().CPlusPlus26 &&

clang/lib/Sema/SemaTemplateInstantiate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,8 @@ TemplateInstantiator::TransformTemplateParmRefExpr(DeclRefExpr *E,
22332233
if (Arg.getKind() != TemplateArgument::Expression) {
22342234
assert(SemaRef.inParameterMappingSubstitution());
22352235
// FIXME: SourceLocation()?
2236-
ExprResult E = SemaRef.BuildExpressionFromNonTypeTemplateArgument(Arg, SourceLocation());
2236+
ExprResult E = SemaRef.BuildExpressionFromNonTypeTemplateArgument(
2237+
Arg, SourceLocation());
22372238
if (E.isInvalid())
22382239
return E;
22392240
Arg = TemplateArgument(E.get(), /*IsCanonical=*/false);

0 commit comments

Comments
 (0)