Skip to content

Conversation

@aaronj0
Copy link
Collaborator

@aaronj0 aaronj0 commented Mar 21, 2025

Add LookupConstructors and fixes logic in IsConstructor for templates. Accumulate constructors with this new lookup in GetClassTemplatedMethods enabling 8 tests. Also splits IsTemplatedFunction into IsTemplatedFunction for FunctionTemplateDecl, and IsTemplateInstantiationOrSpecialization when we have an instantiation or a specialization.

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

if (R.empty())
return;
Sema::NotForRedeclaration);
auto DC = clang::Decl::castToDeclContext(D);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'auto DC' can be declared as 'auto *DC' [llvm-qualified-auto]

Suggested change
auto DC = clang::Decl::castToDeclContext(D);
auto *DC = clang::Decl::castToDeclContext(D);

@aaronj0 aaronj0 force-pushed the constructor-lookups branch 2 times, most recently from 783838a to 222fd9c Compare March 21, 2025 14:17
@codecov
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 75.94%. Comparing base (a9a865e) to head (6e57f12).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/Interpreter/CppInterOp.cpp 85.29% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #535      +/-   ##
==========================================
+ Coverage   75.46%   75.94%   +0.47%     
==========================================
  Files           9        9              
  Lines        3628     3646      +18     
==========================================
+ Hits         2738     2769      +31     
+ Misses        890      877      -13     
Files with missing lines Coverage Δ
include/clang/Interpreter/CppInterOp.h 96.29% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 83.88% <85.29%> (+0.81%) ⬆️
Files with missing lines Coverage Δ
include/clang/Interpreter/CppInterOp.h 96.29% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 83.88% <85.29%> (+0.81%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aaronj0 aaronj0 force-pushed the constructor-lookups branch from 222fd9c to a816f36 Compare March 21, 2025 15:45
@aaronj0
Copy link
Collaborator Author

aaronj0 commented Mar 24, 2025

The added tests here depend on #536 to obtain the function signatures correctly for FunctionTemplateDecls. Without this fix, templated constructors don't return their actual signatures.

@vgvassilev vgvassilev force-pushed the constructor-lookups branch from f3a3b65 to 68b883c Compare March 24, 2025 11:31
@aaronj0 aaronj0 force-pushed the constructor-lookups branch from 68b883c to 0c0872d Compare March 31, 2025 12:31
@aaronj0 aaronj0 force-pushed the constructor-lookups branch 3 times, most recently from 7dc0ddf to dda332e Compare March 31, 2025 12:52
@aaronj0 aaronj0 force-pushed the constructor-lookups branch 2 times, most recently from 0bf59e5 to 247a4f1 Compare March 31, 2025 13:11
aaronj0 added 3 commits March 31, 2025 15:33
Also splits IsTemplatedFunction into `IsTemplatedFunction` for FunctionTemplateDecl, and `IsTemplateInstantiationOrSpecialization` when we have an instantiation or a specialization.
Accumulate constructors with the new lookup in `GetClassTemplatedMethods` enabling 8 tests.
@aaronj0 aaronj0 force-pushed the constructor-lookups branch from abfe633 to 6e57f12 Compare March 31, 2025 16:12
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!

@aaronj0 aaronj0 merged commit e1ace51 into compiler-research:main Mar 31, 2025
55 of 73 checks passed
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