Skip to content

fix: dependent using declarations - #1265

Open
gennaroprota wants to merge 3 commits into
cppalliance:developfrom
gennaroprota:fix/dependent_using_declarations
Open

fix: dependent using declarations#1265
gennaroprota wants to merge 3 commits into
cppalliance:developfrom
gennaroprota:fix/dependent_using_declarations

Conversation

@gennaroprota

Copy link
Copy Markdown
Collaborator

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

  • Source: ASTVisitor traverses 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.
  • Tests: Added new fixtures for a dependent base and a non-dependent one, for a member of every base in a parameter pack, and for a base filtered out as excluded or implementation-defined.
  • Golden tests: No existing goldens change. But the generated pages for using-declarations gain two additional fixes: the typename keyword 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.

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.
@gennaroprota gennaroprota changed the title Fix: dependent using declarations fix: dependent using declarations Aug 26, 2026
@cppalliance-bot

Copy link
Copy Markdown

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

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.12%. Comparing base (e31308f) to head (8468f88).

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           
Flag Coverage Δ
bootstrap 83.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Using-declarations depending on a template parameter (using TemplateParam::member;) are silently dropped

2 participants