In findFunction*, add template instantiation if needed.
Update the test accordingly.
This commit is contained in:
parent
66d3abc12c
commit
1b8795f0c3
@ -563,6 +563,8 @@ namespace cling {
|
||||
// We prefer to get the canonical decl for consistency and ease
|
||||
// of comparison.
|
||||
TheDecl = TheDecl->getCanonicalDecl();
|
||||
if (TheDecl->isTemplateInstantiation() && !TheDecl->isDefined())
|
||||
S.InstantiateFunctionDefinition(SourceLocation(),TheDecl,true);
|
||||
}
|
||||
}
|
||||
return TheDecl;
|
||||
|
@ -125,14 +125,6 @@ public:
|
||||
void A_n(B& b) { b.B_f(); }
|
||||
void A_n(const char *msg, int ndim = 0) { if (ndim) ++msg; }
|
||||
};
|
||||
// Note: In CINT, looking up a class template specialization causes
|
||||
// instantiation, but looking up a function template specialization
|
||||
// does not, so we explicitly request the instantiations we are
|
||||
// going to lookup so they will be there to find.
|
||||
template void A::A_k(int);
|
||||
template void A::A_k(double);
|
||||
template void A::B_k(int);
|
||||
template void A::B_k(double);
|
||||
B b_obj;
|
||||
B* b_ptr = &b_obj;
|
||||
B* b_ary = new B[3];
|
||||
|
Loading…
x
Reference in New Issue
Block a user