Created on1999-08-23.00:00:00 last changed277 months ago
Proposed resolution (10/00):
Remove the last sentence of9.3.4 [dcl.meaning] paragraph 1 (cited above) and the examplethat follows.
Notes from 04/00 meeting:
There was some question as to whether this issue actuallyconstituted a defect in the Standard. John Spicer suggested thatmachine-generated source code would be likely to run afoul of thisprohibition. Francis Glassborow expressed support for a rule thatwould allow full qualification, or qualification relative to thenamespace containing the definition, but not qualification relative toa containing namespace. There was no consensus for moving forwardwith a DR at this point, so the issue was left in "review" status.
9.3.4 [dcl.meaning] paragraph 1says:
In the qualifieddeclarator-id for a class or namespace memberdefinition that appears outside of the member's class or namespace,thenested-name-specifier shall not name any of the namespaces thatenclose the member's definition.This results in the following behavior:
namespace N { namespace M { void f(); void g(); } void M::f(){} // okay void N::M::g(){} // error }I was very surprised when this rule was pointed out to me. The changeappears to have been introduced around the time of the first SantaCruz meeting, but I don't recall discussion of it and could not find amotion related to it.Regardless of where it came from, I also can't understand why it is there.Certainly it shouldn't matterhow you name a given class or namespace.
For example, the standard permits:
namespace N { namespace M { void f(); void g(); } namespace X = M; namespace Y = N::M; void X::f(){} // okay void Y::g(){} // okay }So, it is okay to use an alias forN::M,but not to useN::M directly.Note that itis okay to useN::Min any other context at this pointin the program (i.e., the rule is a specific restriction on declaratornames, not a general rule on the use of qualified names).Does anyone recall the intent of this rule or any rationale for itsexistence?
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2003-04-25 00:00:00 | admin | set | status: dr -> tc1 |
| 2000-11-18 00:00:00 | admin | set | messages: +msg445 |
| 2000-11-18 00:00:00 | admin | set | status: review -> dr |
| 2000-05-21 00:00:00 | admin | set | messages: +msg333 |
| 2000-05-21 00:00:00 | admin | set | status: drafting -> review |
| 2000-02-23 00:00:00 | admin | set | status: open -> drafting |
| 1999-08-23 00:00:00 | admin | create | |