n3290 : Elaborated type specifiers syntax changed?
point From 2003 C++03 Document :
Elaborated type specifiers :section 3.4.4, para 1:
"An elaborated-type-specifier may be used to refer to a
previously declared class-name or enum-name even though
the name has been hidden by a non-type declaration. **The
class-name or enum-name in the elaborated-type-specifier
may either be a simple identifier or be a qualified-id.**"
But in n3290 Draft they changed the Elaborated type specifiers (7.1.6.3)
7.1.6.3: Elaborated type specifiers
elaborated-type-specifier:
class-key attribute-specifier-seqopt nested-name-specifieropt identifier
class-key nested-name-specifieropt templateopt simple-template-id
enum nested-name-specifieropt identifier
May i know
1) what is the problem with earlier Syntax which supports typename c++03
7.1.5.3 Elaborated type specifiers
elaborated-type-specifier:
class-key ::opt nested-name-specifieropt identifier
class-key ::opt nested-name-specifieropt templateopt template-id
enum ::opt nested-name-specifieropt identifier
typename ::opt nested-name-specifier identifier
typename ::opt nested-name-specifier templateopt template-id
2) IS that really compiler is following/not folling this rule...(which compiler supports this change )
3) When开发者_开发技巧 coming to the above point 3.4.4/1st
The class-name or enum-name in the elaborated-type-specifier
may either be a simple identifier or be a qualified-id
why it is not allowed in c++0x.
Please any one explain this ? Please any one explain this ?
(When iam trying to add c++0x TAG it is not ..tagging ..please any one ..Add c++0x tag ? )
- This is a simple reorganization.
typename-specifier
is now not a kind ofelaborated-type-specifier
, but they are both kinds oftrailing-type-specifier
. - It's not clear what the compilers should do. Can you think of valid C++03 code that is not a valid C++0x?
- What exactly is not allowed in C++0x? The grammar says a qualified-id is allowed there, as
nested-name-specifier_opt identifier
.
精彩评论