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

Fix template instantiation reporting #1136

Merged

Conversation

bolshakov-a
Copy link
Contributor

Full template specialization type use requires full information about its template-argument-dependent fields and nested typedefs. But earlier, it wasn't reported in many cases when template specialization type isn't written explicitly in non-fwd-decl context.

iwyu.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@kimgr kimgr left a comment

Choose a reason for hiding this comment

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

Very nice, thank you! See some comments inline, but generally this lgtm.

iwyu.cc Outdated Show resolved Hide resolved
iwyu.cc Outdated Show resolved Hide resolved
tests/cxx/array.cc Outdated Show resolved Hide resolved
tests/cxx/indirect.h Outdated Show resolved Hide resolved
tests/cxx/member_expr.cc Outdated Show resolved Hide resolved
iwyu_ast_util.cc Show resolved Hide resolved
tests/cxx/template_args.cc Show resolved Hide resolved
Copy link
Contributor

@kimgr kimgr left a comment

Choose a reason for hiding this comment

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

Just a request for a comment, otherwise looks great! Thanks for taking the time to analyze all my questions.

iwyu.cc Outdated Show resolved Hide resolved
tests/cxx/template_args.cc Show resolved Hide resolved
@kimgr kimgr added this to the iwyu 0.20 milestone Dec 15, 2022
Names starting with an underscore aren't allowed in a global namespace,
according to the standard.
Full template specialization type use requires full information about
its template-argument-dependent fields and nested typedefs. But earlier,
it wasn't reported in many cases when template specialization type isn't
written explicitly in non-fwd-decl context.
Non-sugared template specialization type template arguments are already
analyzed due to 'TraverseType' call inside
'InstantiatedTemplateVisitor::TraverseSubstTemplateTypeParmTypeHelper'
and subsequent 'TraverseTemplateSpecializationTypeHelper' call.
Components of sugared template specialization types are added into
resugar_map, otherwise their template arguments would not be reported.
Test case has been extended.
It became superfluous after generalization of reporting types needed
for template instantiation.
@kimgr kimgr merged commit 278ba9d into include-what-you-use:master Dec 16, 2022
@kimgr
Copy link
Contributor

kimgr commented Dec 16, 2022

Excellent, thanks!

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.

None yet

2 participants