A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/2218.html below:

CWG Issue 2218

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

2218. Ambiguity and namespace aliasesSection: 6.5  [basic.lookup]     Status: C++17     Submitter: Richard Smith     Date: 2015-12-29

[Adopted at the February/March, 2017 meeting.]

There is implementation divergence on the status of the following example:

  namespace A { namespace B { int x; } }
  namespace C { namespace B = A::B; }
  using namespace A;
  using namespace C;
  int x = B::x;

This should presumably be valid: the lookup of B finds A::B and C::B, but it is not ambiguous because they denote the same entity. A similar example with a using-declaration or alias-declaration seems to be universally accepted. Perhaps the lookup rules need to be clarified regarding the status of this example.

Proposed resolution (November, 2016):

Change 6.5 [basic.lookup] paragraph 1 as follows:

The name lookup rules apply uniformly to all names (including typedef-names (9.2.4 [dcl.typedef]), namespace-names (9.9 [basic.namespace]), and class-names (11.3 [class.name])) wherever the grammar allows such names in the context discussed by a particular rule. Name lookup associates the use of a name with a declaration set of declarations (6.2 [basic.def]) of that name. Name lookup shall find an unambiguous declaration for the name (see 6.5.2 [class.member.lookup]). Name lookup may associate more than one declaration with a name if it finds the name to be a function name; The declarations found by name lookup shall either all declare the same entity or shall all declare functions; in the latter case, the declarations are said to form a set of overloaded functions (_N4868_.12.2 [over.load]). Overload resolution...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4