<div dir="ltr"><div><div><div><div>Good evening,<br><br></div>I am attempting to access the default argument of an instantiated function template. But when I attempt to getDefaultArg() on the ParamVarDecl*, Clang fails an assertion that it was not instantiated. I have attempted various instantiation functions on Sema but so far have had little luck. <br>
<br></div>In this example test case, I access the constructors of std::string (obtained by looking up "string" through qualified lookup), giving back an array of NamedDecl. I place them all in an OverloadCandidateSet using sema::AddOverloadCandidate, and resolve with some arguments. I get the result back using BestViableFunction (incl. error check). Then I iterate the parameters of the result and attempt to inspect the default argument for the parameter, if there is one.<br>
<br></div>I apologize if this is the wrong list, I'm never quite sure whether API usage qualifies as users or dev. If you could aid me with this or direct me to a more suitable location, I would appreciate it.<br><br>
</div>Thanks.<br><div><br><br><br></div></div>