@@ -714,8 +714,8 @@ populate(
714714 // CXXBaseSpecifier::getEllipsisLoc indicates whether the
715715 // base was a pack expansion; a PackExpansionType is not built
716716 // for base-specifiers
717- if (!BaseType.valueless_after_move () &&
718- B.getEllipsisLoc ().isValid ())
717+ MRDOCS_ASSERT (!BaseType.valueless_after_move ());
718+ if ( B.getEllipsisLoc ().isValid ())
719719 {
720720 BaseType->IsPackExpansion = true ;
721721 }
@@ -1341,11 +1341,7 @@ populate(
13411341 for (auto it = Template.Args .begin (); it != Template.Args .end ();)
13421342 {
13431343 auto & arg = *it;
1344- if (arg.valueless_after_move ())
1345- {
1346- ++it;
1347- continue ;
1348- }
1344+ MRDOCS_ASSERT (!arg.valueless_after_move ());
13491345 if (auto * T = dynamic_cast <TypeTArg*>(arg.operator ->()))
13501346 {
13511347 MRDOCS_ASSERT (!T->Type .valueless_after_move ());
@@ -1496,14 +1492,15 @@ populate(
14961492 Polymorphic<TParam>& I,
14971493 NamedDecl const * N)
14981494{
1495+ MRDOCS_ASSERT (!I.valueless_after_move ());
14991496 visit (N, [&]<typename DeclTy>(DeclTy const * P)
15001497 {
15011498 constexpr Decl::Kind kind =
15021499 DeclToKind<DeclTy>();
15031500
15041501 if constexpr (kind == Decl::TemplateTypeParm)
15051502 {
1506- if (I. valueless_after_move () )
1503+ if (I-> Kind != TParamKind::Type )
15071504 {
15081505 I = Polymorphic<TParam>(std::in_place_type<TypeTParam>);
15091506 }
@@ -1532,7 +1529,7 @@ populate(
15321529 }
15331530 else if constexpr (kind == Decl::NonTypeTemplateParm)
15341531 {
1535- if (I. valueless_after_move () )
1532+ if (I-> Kind != TParamKind::Constant )
15361533 {
15371534 I = Polymorphic<TParam>(std::in_place_type<ConstantTParam>);
15381535 }
@@ -1547,7 +1544,7 @@ populate(
15471544 }
15481545 else if constexpr (kind == Decl::TemplateTemplateParm)
15491546 {
1550- if (I. valueless_after_move () )
1547+ if (I-> Kind != TParamKind::Template )
15511548 {
15521549 I = Polymorphic<TParam>(std::in_place_type<TemplateTParam>);
15531550 }
@@ -1563,8 +1560,7 @@ populate(
15631560 auto & Param
15641561 = i < Result->Params .size () ?
15651562 Result->Params [i] :
1566- Result->Params .emplace_back (
1567- nullable_traits<Polymorphic<TParam>>::null ());
1563+ Result->Params .emplace_back (std::in_place_type<TypeTParam>);
15681564 populate (Param, TP);
15691565 }
15701566 if (TTPD->hasDefaultArgument () && !Result->Default )
@@ -1578,6 +1574,7 @@ populate(
15781574 MRDOCS_UNREACHABLE ();
15791575 });
15801576
1577+ MRDOCS_ASSERT (!I.valueless_after_move ());
15811578 if (I->Name .empty ())
15821579 {
15831580 I->Name = extractName (N);
@@ -1615,10 +1612,10 @@ populate(
16151612 while (explicitIt != ExplicitTemplateParameters.end ())
16161613 {
16171614 NamedDecl const * P = TPL->getParam (i);
1618- auto & Param = i < TI. Params . size () ?
1619- TI.Params [i] :
1620- TI.Params . emplace_back (
1621- nullable_traits<Polymorphic<TParam>>:: null () );
1615+ Polymorphic<TParam> & Param =
1616+ i < TI.Params . size () ?
1617+ TI.Params [i] :
1618+ TI. Params . emplace_back (std::in_place_type<TypeTParam> );
16221619 populate (Param, P);
16231620 ++explicitIt;
16241621 ++i;
0 commit comments