@@ -1884,25 +1884,32 @@ extractSFINAEInfo(QualType const T)
18841884 // Find the parameter that represents the SFINAE result
18851885 auto const Args = templateInfo->Arguments ;
18861886 MRDOCS_SYMBOL_TRACE (Args, context_);
1887- auto const param_arg = tryGetTemplateArgument (
1887+ auto const resultType = tryGetTemplateArgument (
18881888 SFINAEControl->Parameters , Args, SFINAEControl->ParamIdx );
1889- MRDOCS_CHECK_OR (param_arg , std::nullopt );
1890- MRDOCS_SYMBOL_TRACE (*param_arg , context_);
1889+ MRDOCS_CHECK_OR (resultType , std::nullopt );
1890+ MRDOCS_SYMBOL_TRACE (*resultType , context_);
18911891
18921892 // Create a vector of template arguments that represent the
18931893 // controlling parameters of the SFINAE template
1894- std::vector<TemplateArgument> ControllingArgs;
1894+ SFINAEInfo Result;
1895+ Result.Type = resultType->getAsType ();
18951896 for (std::size_t I = 0 ; I < Args.size (); ++I)
18961897 {
18971898 if (SFINAEControl->ControllingParams [I])
18981899 {
18991900 MRDOCS_SYMBOL_TRACE (Args[I], context_);
1900- ControllingArgs.emplace_back (Args[I]);
1901+ Expr* E = Args[I].getAsExpr ();
1902+ if (!E)
1903+ {
1904+ continue ;
1905+ }
1906+ Result.Constraints .emplace_back ();
1907+ populate (Result.Constraints .back (), E);
19011908 }
19021909 }
19031910
19041911 // Return the main type and controlling types
1905- return SFINAEInfo{param_arg-> getAsType (), std::move (ControllingArgs)} ;
1912+ return Result ;
19061913}
19071914
19081915std::optional<ASTVisitor::SFINAEControlParams>
@@ -1963,16 +1970,16 @@ getSFINAEControlParams(
19631970
19641971 // Find the index of the parameter that represents the SFINAE result
19651972 // in the underlying template arguments
1966- auto param_arg = tryGetTemplateArgument (
1973+ auto resultType = tryGetTemplateArgument (
19671974 sfinaeControl->Parameters ,
19681975 underlyingTemplateInfo->Arguments ,
19691976 sfinaeControl->ParamIdx );
1970- MRDOCS_CHECK_OR (param_arg , std::nullopt );
1971- MRDOCS_SYMBOL_TRACE (*param_arg , context_);
1977+ MRDOCS_CHECK_OR (resultType , std::nullopt );
1978+ MRDOCS_SYMBOL_TRACE (*resultType , context_);
19721979
19731980 // Find the index of the parameter that represents the SFINAE result
19741981 // in the primary template arguments
1975- unsigned ParamIdx = FindParam (ATD->getInjectedTemplateArgs (context_), *param_arg );
1982+ unsigned ParamIdx = FindParam (ATD->getInjectedTemplateArgs (context_), *resultType );
19761983
19771984 // Return the controlling parameters with values corresponding to
19781985 // the primary template arguments
@@ -2060,11 +2067,11 @@ getSFINAEControlParams(
20602067 }
20612068
20622069 auto [template_params, controlling_params, param_idx] = *sfinae_result;
2063- auto param_arg = tryGetTemplateArgument (
2070+ auto resultType = tryGetTemplateArgument (
20642071 template_params, sfinae_info->Arguments , param_idx);
2065- if (! param_arg )
2072+ if (! resultType )
20662073 return true ;
2067- auto CurrentTypeFromBase = param_arg ->getAsType ();
2074+ auto CurrentTypeFromBase = resultType ->getAsType ();
20682075 if (CurrentType.isNull ())
20692076 {
20702077 CurrentType = CurrentTypeFromBase;
0 commit comments