Take it easy. You don't appear to have a good understanding of the compiler guts. What you said above was quite clueless, hence the reaction.
Also, slashdot as a metric of incivility - that's bold :)
> Read Section 5 for the rationale ..
I read the whole thing before I first posted in this thread. Since they are extending function declarations with a new construct, nothing precludes them from creating a scope for it. In other words, declspec() arguments should have a scope of a function declaration they appear in. Their claims that this also complicates parsing is just a speculation, and not too convincing one.
I find it strange to say it's clueless when it's, in fact, the rationale used by the committee members. I don't appreciate being mocked when I'm trying to have a discussion. Compilers also happen to be part of my work, but that's beside the point.
Introducing a new scope would, I think, introduce more corner cases than the ugliness of the new syntax. (And I do agree that it's ugly in the context of C++ which already has a function syntax.) Right now, scopes are only introduced inside namespaces, classes/structs, functions, and explicit braces. Having a new scope start before a function and its parameters are declared is counter-intuitive to me.
Now, I might actually be willing to take counter-intuitive semantics to avoid the syntactic ugliness, but that's not my point. The point I've been trying to make is that the committee has considered these issues; they didn't blindly make a bunch of decrees.
Your first response rebutted the point that I didn't make. Your second response was stating trivial stuff that was obvious to the point of not being even worth mentioning. So, yeah, I was also trying to have a discussion and go over finer points of the alternatives and why they used the least attractive one, but it didn't quite work.
> Right now, scopes are only introduced inside namespaces, classes/structs, functions, and explicit braces.
You forgot for loops. Their scoping is virtually identical to a function declaration scope if latter were to be used.
> The point I've been trying to make is that the committee has considered these issues; they didn't blindly make a bunch of decrees.
You have to realize that not all decisions made by the committee are based on a technical merit. There is quite a bit of politics and ego involved. Whatever they converge on might be a result that everyone is equally unhappy with rather than the opposite. Taking their decisions as written in stone makes very little sense .. unless, of course, they come directly from Bjarne :)
A well-known anecdote is a history of standardizing IPsec suite of protocols - a showcase for ego clashing. It took over two years to converge to something that the majority of a workgroup agreed with. It was a compromise on top of a compromise and the result was one of the most ambiguous and awkwardly written set of RFCs.
This isn't slashdot. Please be civil.
Read Section 5 for the rationale provided by the committee members who proposed the syntax: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n170...
In particular, the name collision problem does not happen with classes because each class is a new scope.