Title
Lookup and friend template declarations
Status
cd3
Section
_N4868_.9.8.2.3 [namespace.memdef]
Submitter
Richard Smith

Created on 2012-01-04.00:00:00 last changed 123 months ago

Messages

Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

  1. Change 6.5.4 [basic.lookup.argdep] paragraph 1 as follows:

  2. ...in those namespaces, namespace-scope friend function or function template declarations (11.3) not otherwise visible may be found...
  3. Change _N4868_.9.8.2.3 [namespace.memdef] paragraph 3 as follows:

  4. Every name first declared in a namespace is a member of that namespace. If a friend declaration in a non-local class first declares a class, or function, class template, or function template95 the friend class or function is a member of the innermost enclosing namespace. The name of the friend is not found by unqualified lookup (6.5.3 [basic.lookup.unqual]) or by qualified lookup (6.5.5 [basic.lookup.qual]) until a matching declaration is provided in that namespace scope (either before or after the class definition granting friendship). If a friend function or function template is called, its name may be found by the name lookup that considers functions from namespaces and classes associated with the types of the function arguments (6.5.4 [basic.lookup.argdep]). If the name in a friend declaration...
Date: 2021-02-24.00:00:00

According to _N4868_.9.8.2.3 [namespace.memdef] paragraph 3,

If a friend declaration in a non-local class first declares a class or function95 the friend class or function is a member of the innermost enclosing namespace. The name of the friend is not found by unqualified lookup (6.5.3 [basic.lookup.unqual]) or by qualified lookup (6.5.5 [basic.lookup.qual]) until a matching declaration is provided in that namespace scope (either before or after the class definition granting friendship).

This wording does not, but probably should, apply to friend declarations of function templates and class templates as well.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: + msg4142
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: + msg3717
2012-02-27 00:00:00adminsetstatus: open -> ready
2012-01-04 00:00:00admincreate