Created on 2000-09-14.00:00:00 last changed 197 months ago
[Voted into WP at April 2003 meeting.]
Proposed resolution (October 2002):
As given in N1376=02-0034. Note that the inserts and strikeouts in that document do not display correctly in all browsers; <del> --> <strike> and <ins> --> <b>, and the similar changes for the closing delimiters, seem to do the trick.
I have some concerns with the description of name lookup for elaborated type specifiers in 6.5.6 [basic.lookup.elab]:
Paragraph 2 has some parodoxical statements concerning looking up names that are simple identifers:
If the elaborated-type-specifier refers to an enum-name and this lookup does not find a previously declared enum-name, the elaborated-type-specifier is ill-formed. If the elaborated-type-specifier refers to an [sic] class-name and this lookup does not find a previously declared class-name... the elaborated-type-specifier is a declaration that introduces the class-name as described in 6.4.2 [basic.scope.pdecl]."
It is not clear how an elaborated-type-specifier can refer to an enum-name or class-name given that the lookup does not find such a name and that class-name and enum-name are not part of the syntax of an elaborated-type-specifier.
The second sentence quoted above seems to suggest that the name found will not be used if it is not a class name. typedef-name names are ill-formed due to the sentence preceding the quote. If lookup finds, for instance, an enum-name then a new declaration will be created. This differs from C, and from the enum case, and can have surprising effects:
struct S { enum E { one = 1 }; class E* p; // declares a global class E? };
Was this really the intent? If this is the case then some more work is needed on 6.5.6 [basic.lookup.elab]. Note that the section does not make finding a type template formal ill-formed, as is done in 9.2.9.5 [dcl.type.elab]. I don't see anything that makes a type template formal name a class-name. So the example in 9.2.9.5 [dcl.type.elab] of friend class T; where T is a template type formal would no longer be ill-formed with this interpretation because it would declare a new class T.
(See also issue 254.)
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2003-04-25 00:00:00 | admin | set | messages: + msg857 |
2003-04-25 00:00:00 | admin | set | status: ready -> wp |
2002-11-08 00:00:00 | admin | set | status: review -> ready |
2002-05-10 00:00:00 | admin | set | messages: + msg619 |
2002-05-10 00:00:00 | admin | set | status: drafting -> review |
2000-11-18 00:00:00 | admin | set | messages: + msg416 |
2000-11-18 00:00:00 | admin | set | status: open -> drafting |
2000-09-14 00:00:00 | admin | create |