cplusplus / cplusplus/draft

An improvement to ADL for the name declared by a friend declaration

Open
#5,302 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[basic.lookup.argdep] p4 is saying:

Argument-dependent lookup finds all declarations of functions and function templates that

  • are found by a search of any associated namespace, or
  • are declared as a friend ([class.friend]) of any class with a reachable definition in the set of associated entities, or

It sounds like we impose no requirement on the friend declarations when ADL. According to [dcl.meaning.general] p2, the declaration of a friend declaration does not bind a name. we define the concept for wording search that works on the name is bound. It is not suitable for friend declaration. The improvement is:

Argument-dependent lookup finds all declarations of functions and function templates that

  • [...], or
  • are declared as a friend of any class with a reachable definition in the set of associated entities, where the terminal names of the declarator-ids of the declarations are the same as the name that is being found.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the draft wording for [basic.lookup.argdep] p4 and compare it with [dcl.meaning.general] p2 and [class.friend]. Check how friend declarations are represented in the draft source, then update the ADL wording so the terminal names of the declarator-ids match the name being found; confirm the resulting specification is consistent with those referenced clauses.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.