File tree Expand file tree Collapse file tree 3 files changed +34
-8
lines changed
Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -205,8 +205,8 @@ enum class TemplateSubstitutionKind : char {
205205
206206 // / Add a new outmost level to the multi-level template argument
207207 // / list.
208- // / A 'Final' substitution means that Subst* nodes won 't be built
209- // / for the replacements .
208+ // / A 'Final' substitution means that these Args don 't need to be
209+ // / resugared later .
210210 void addOuterTemplateArguments (Decl *AssociatedDecl, ArgList Args,
211211 bool Final) {
212212 assert (!NumRetainedOuterLevels &&
Original file line number Diff line number Diff line change @@ -606,10 +606,9 @@ ConstraintSatisfactionChecker::SubstitutionInTemplateArguments(
606606 Constraint.mappingOccurenceList ();
607607 // The empty MLTAL situation should only occur when evaluating non-dependent
608608 // constraints.
609- if (!MLTAL.getNumSubstitutedLevels ())
610- MLTAL.addOuterTemplateArguments (TD, {}, /* Final=*/ false );
611- SubstitutedOuterMost =
612- llvm::to_vector_of<TemplateArgument>(MLTAL.getOutermost ());
609+ if (MLTAL.getNumSubstitutedLevels ())
610+ SubstitutedOuterMost =
611+ llvm::to_vector_of<TemplateArgument>(MLTAL.getOutermost ());
613612 unsigned Offset = 0 ;
614613 for (unsigned I = 0 , MappedIndex = 0 ; I < Used.size (); I++) {
615614 TemplateArgument Arg;
@@ -627,8 +626,10 @@ ConstraintSatisfactionChecker::SubstitutionInTemplateArguments(
627626 if (Offset < SubstitutedOuterMost.size ())
628627 SubstitutedOuterMost.erase (SubstitutedOuterMost.begin () + Offset);
629628
630- MLTAL.replaceOutermostTemplateArguments (TD, SubstitutedOuterMost);
631- return std::move (MLTAL);
629+ MultiLevelTemplateArgumentList SubstitutedTemplateArgs;
630+ SubstitutedTemplateArgs.addOuterTemplateArguments (TD, SubstitutedOuterMost,
631+ /* Final=*/ false );
632+ return std::move (SubstitutedTemplateArgs);
632633}
633634
634635ExprResult ConstraintSatisfactionChecker::EvaluateSlow (
Original file line number Diff line number Diff line change @@ -1416,6 +1416,31 @@ concept IsEntitySpec =
14161416
14171417}
14181418
1419+ namespace case8 {
1420+
1421+ template <class T >
1422+ struct type_identity {
1423+ using type = T;
1424+ };
1425+
1426+ template <typename Inner>
1427+ struct Cat {};
1428+
1429+ template <typename T>
1430+ concept CatConcept = requires {
1431+ []<class Inner >(type_identity<Cat<Inner>>) {}(type_identity<T>{});
1432+ };
1433+
1434+ template <typename Dummy>
1435+ struct Feeder {
1436+ template <CatConcept Dummy2>
1437+ void feed () noexcept {}
1438+ };
1439+
1440+ void main () { Feeder<int >{}.feed <Cat<int >>(); }
1441+
1442+ }
1443+
14191444}
14201445
14211446namespace GH162125 {
You can’t perform that action at this time.
0 commit comments