Skip to content

Conversation

@aaronj0
Copy link
Collaborator

@aaronj0 aaronj0 commented Apr 12, 2024

This tests both interfaces (GetClassMethods, GetFunctionTemplatedDecls) that use the GetClassDecls static function simultaneously under the same scope

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@github-actions github-actions bot left a 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

}

TEST(FunctionReflectionTest, GetClassDecls) {
std::vector<Decl*> Decls, SubDecls;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'Decls' is not initialized [cppcoreguidelines-init-variables]

Suggested change
std::vector<Decl*> Decls, SubDecls;
std::vector<Decl*> Decls = 0, SubDecls;

GetAllTopLevelDecls(code, Decls);
GetAllSubDecls(Decls[0], SubDecls);

std::vector<Cpp::TCppFunction_t> methods;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'methods' is not initialized [cppcoreguidelines-init-variables]

Suggested change
std::vector<Cpp::TCppFunction_t> methods;
std::vector<Cpp::TCppFunction_t> methods = 0;

GetAllSubDecls(Decls[0], SubDecls);

std::vector<Cpp::TCppFunction_t> methods;
std::vector<Cpp::TCppFunction_t> template_methods;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'template_methods' is not initialized [cppcoreguidelines-init-variables]

Suggested change
std::vector<Cpp::TCppFunction_t> template_methods;
std::vector<Cpp::TCppFunction_t> template_methods = 0;

@vgvassilev vgvassilev merged commit b189990 into compiler-research:main Apr 12, 2024
@aaronj0 aaronj0 deleted the template-tests branch May 14, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants