Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to check if typedefs are being unnecessarily resolved #124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sudo-panda
Copy link
Contributor

Same as #97

Copy link

@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

};
)");

clang::NamedDecl *ClassTDT = (clang::NamedDecl*) Cpp::GetNamed("TDT");

Choose a reason for hiding this comment

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

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
clang::NamedDecl *ClassTDT = (clang::NamedDecl*) Cpp::GetNamed("TDT");
auto *ClassTDT = (clang::NamedDecl*) Cpp::GetNamed("TDT");


clang::NamedDecl *ClassTDT = (clang::NamedDecl*) Cpp::GetNamed("TDT");
auto *CtorTDT =
(clang::CXXConstructorDecl*) Cpp::GetDefaultConstructor(ClassTDT);

Choose a reason for hiding this comment

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

warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]

      (clang::CXXConstructorDecl*) Cpp::GetDefaultConstructor(ClassTDT);
      ^

void* objectTDT = nullptr;
FCI_CtorTDT.Invoke((void*)&objectTDT);
EXPECT_TRUE(objectTDT != nullptr);
clang::NamedDecl *TDT_f = (clang::NamedDecl*) Cpp::GetNamed("f", ClassTDT);

Choose a reason for hiding this comment

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

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
clang::NamedDecl *TDT_f = (clang::NamedDecl*) Cpp::GetNamed("f", ClassTDT);
auto *TDT_f = (clang::NamedDecl*) Cpp::GetNamed("f", ClassTDT);

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.

1 participant