fix: dependent using declarations - #1265
Open
gennaroprota wants to merge 3 commits into
Open
Conversation
A using-declaration of the kind `TemplateParam::Name` is unresolved until the template is instantiated, so Clang keeps it in an `UnresolvedUsingValueDecl` or `UnresolvedUsingTypenameDecl` rather than in a `UsingDecl` with shadow declarations. Only the latter was traversed, so re-exporting a member of a base that is itself a template parameter left nothing in the documentation, and no diagnostic. The `typename` form is now recorded as such, dependent base or not, where it used to be recorded as a plain `using`. Note that setting that class for the first time exposed the signature partial rendering it as `using typenameBase::size_type`, with no intervening space between `typename` and the name. Fixes cppalliance#1258.
Three using-declaration cases end up with no target. One is a base that is a template parameter, covered by the fix in the previous commit. The other two had no coverage at all: - A member of every base in a pack, where the qualifier depends on the pack, so nothing is named until instantiation. - A member of a base that is filtered out, where the target is dropped for being excluded or an implementation detail, while the qualifier survives in the name introduced by the declaration.
The section handed the table the symbol ids themselves, so a using-declaration listed the hash of what it introduces instead of the name; and the descriptions went missing with it, because the test for whether any of them is documented could not find a doc comment on an id. They are resolved through the corpus now.
|
An automated preview of the documentation is available at https://1265.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-08-26 15:48:39 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1265 +/- ##
========================================
Coverage 83.12% 83.12%
========================================
Files 35 35
Lines 3662 3662
Branches 844 844
========================================
Hits 3044 3044
Misses 410 410
Partials 208 208
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes an issue for which a using-declaration re-exporting a member of a base which is itself a template parameter was entirely dropped from the output (issue #1258).
Changes
ASTVisitortraverses the two unresolved using-declaration kinds and records the name each introduces. Note that this is the only thing that can be recorded, as the qualifier depends on a template parameter, so, until instantiation, there are no declarations to point at.typenamekeyword isn't attached to what follows (due to a missing space), and the Introduced Symbols table lists names rather than IDs.Testing
New fixtures are added, as mentioned above.
Documentation
No change needed (the manual does not say which using-declarations are extracted, and the landing page, which says using declarations all come through, is now true of the dependent form too).
Fixes #1258.