-
Notifications
You must be signed in to change notification settings - Fork 31
Update GetFunctionArgName API for template functions #224
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update GetFunctionArgName API for template functions #224
Conversation
@@ -829,6 +838,19 @@ TEST(FunctionReflectionTest, GetFunctionArgName) { | |||
EXPECT_EQ(Cpp::GetFunctionArgName(Decls[1], 1), "d"); | |||
EXPECT_EQ(Cpp::GetFunctionArgName(Decls[1], 2), "l"); | |||
EXPECT_EQ(Cpp::GetFunctionArgName(Decls[1], 3), "ch"); | |||
|
|||
// EXPECT_EQ(Cpp::GetFunctionArgName(Decls[2], 0), ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the commented code or I comment it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests pass, have uncommented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -3047,8 +3047,12 @@ namespace Cpp { | |||
std::string GetFunctionArgName(TCppFunction_t func, TCppIndex_t param_index) | |||
{ | |||
auto *D = (clang::Decl *)func; | |||
auto *FD = llvm::cast<clang::FunctionDecl>(D); | |||
auto PI = FD->getParamDecl(param_index); | |||
clang::ParmVarDecl* PI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'PI' is not initialized [cppcoreguidelines-init-variables]
clang::ParmVarDecl* PI; | |
clang::ParmVarDecl* PI = nullptr; |
No description provided.