Skip to content

Commit 2c0e719

Browse files
committed
Update function documentation and tests
1 parent dc245a4 commit 2c0e719

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

include/clang/Interpreter/CppInterOp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,11 @@ namespace Cpp {
292292
CPPINTEROP_API void GetClassMethods(TCppScope_t klass,
293293
std::vector<TCppFunction_t>& methods);
294294

295-
///\returns Template function pointer list to add proxies for
296-
/// un-instantiated/non-overloaded templated methods
295+
/// Template function pointer list to add proxies for un-instantiated/
296+
/// non-overloaded templated methods
297+
///\param[in] klass - Pointer to the scope/class under which the methods have
298+
/// to be retrieved
299+
///\param[out] methods - Vector of methods in the class
297300
CPPINTEROP_API void
298301
GetFunctionTemplatedDecls(TCppScope_t klass,
299302
std::vector<TCppFunction_t>& methods);

lib/Interpreter/CppInterOp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,10 +993,10 @@ namespace Cpp {
993993
if (func->getNumParams() != arg_types.size())
994994
continue;
995995

996-
// TODO : first score based on the type similarity before forcing
996+
// FIXME : first score based on the type similarity before forcing
997997
// instantiation try instantiating
998-
TCppFunction_t instantiated = InstantiateTemplate(
999-
candidate, arg_types.data(), arg_types.size());
998+
TCppFunction_t instantiated =
999+
InstantiateTemplate(candidate, arg_types.data(), arg_types.size());
10001000
if (instantiated)
10011001
return instantiated;
10021002

unittests/CppInterOp/FunctionReflectionTest.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,14 @@ TEST(FunctionReflectionTest, ExistsFunctionTemplate) {
487487
EXPECT_FALSE(Cpp::ExistsFunctionTemplate("f", Decls[2]));
488488
}
489489

490-
// TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) {
491-
// Cpp::CreateInterpreter();
492-
// std::string code = R"(#include <memory>)";
493-
// Interp->process(code);
494-
// const char* str = "std::make_unique<int,int>";
495-
// auto* Instance1 = (Decl*)Cpp::InstantiateTemplateFunctionFromString(str);
496-
// EXPECT_TRUE(Instance1);
497-
// }
490+
TEST(FunctionReflectionTest, InstantiateTemplateFunctionFromString) {
491+
Cpp::CreateInterpreter();
492+
std::string code = R"(#include <memory>)";
493+
Interp->process(code);
494+
const char* str = "std::make_unique<int,int>";
495+
auto* Instance1 = (Decl*)Cpp::InstantiateTemplateFunctionFromString(str);
496+
EXPECT_TRUE(Instance1);
497+
}
498498

499499
TEST(FunctionReflectionTest, InstantiateFunctionTemplate) {
500500
std::vector<Decl*> Decls;

0 commit comments

Comments
 (0)