Description of bug
Because of clang's lazy instantiation klass->hasDefinition() returns false and implicit members are not created for template specializations.
From GetClassDecl function:
if (CXXRD->hasDefinition())
CXXRD = CXXRD->getDefinition();
getSema().ForceDeclarationOfImplicitMembers(CXXRD);
Test:
TYPED_TEST(CPPINTEROP_TEST_MODE, FunctionReflection_GetClassDecls2) {
std::vector<Decl*> Decls, SubDecls;
std::string code = R"(template<typename T>
class Klass {
T value;
};
using KlassInt = Klass<int>;)";
GetAllTopLevelDecls(code, Decls);
std::vector<Cpp::TCppFunction_t> methods;
Cpp::GetClassMethods(Decls[1], methods);
EXPECT_EQ(methods.size(), 10);
}
this test fails because of this bug with this output:
[ RUN ] CppInterOpTest/InProcessJIT.FunctionReflection_GetClassDecls2
/home/keremsahn/CppInterOp/unittests/CppInterOp/FunctionReflectionTest.cpp:352:
Failure
Expected equality of these values:
methods.size()
Which is: 0
10
What operating system was you using when the bug occured?
Ubuntu
What is the architechture of the cpu on your system?
X86
What did you build CppInterOp against?
No response
Description of bug
Because of clang's lazy instantiation klass->hasDefinition() returns false and implicit members are not created for template specializations.
From GetClassDecl function:
Test:
this test fails because of this bug with this output:
What operating system was you using when the bug occured?
Ubuntu
What is the architechture of the cpu on your system?
X86
What did you build CppInterOp against?
No response