Paul said:
Where is your proof that the standard condemns this code as non C++?
The standard doesn't need to go through every possible combination of
possible syntax errors and condemn them as "non C++".
If a syntax is not valid as defined by the standard, but still compiles,
it's by definition a non-standard extension in that specific compiler.
I posted a quote that show the standard endorses this and you say that this
is not implementation defined behaviour , but implementation extensions.
What crap. If the standard said something negative about impl-def-behavior
you wouldn't be saying that.
That paragraph makes no sense.
"Implementation-defined behavior" and "an implementation-speficic
extension" are two completely different and independent things. You
are committing a fallacy of equivocation.
For example, the value of "sizeof(int)" is implementation-defined.
"typeof(expression)" is an example of a compiler extension (in this case
a gcc extension). The former is standard-compliant, the latter isn't.
This is implementation defined behaviour and the standard endorses this.
"Implementation-defined behavior" and "implementation-specific
extension" are two completely different things.
I'm not saying it is *standard* , I am quite clear that it is
implementation specific.
You are not saying it's standard, but when I say it's not standard,
you object. You are making no sense.
But so what if its not defined in the standard, this does not mean it is not
valid C++, and it certainly doesn't automatically imply it's sub-standard.
So your definition of "valid C++" is that if some compiler accepts it,
it's "valid C++".
I suppose that makes, for example, Objective-C "valid C++" because gcc
can compile Objective-C inside C++ source code.
Of course don't expect eg. Visual C++ to support a program written like
that, but hey, it's still "valid C++".
Your argument is that it is not defined in the C++ standard therefore it's
not C++. This is simply incorrect.
If this was the case there would be hundred of libraries and extensions in
the wild that were sub-standard, non-C++ code.
If a library conforms to the specification of the C++ standard, then it
is standard-compliant (but not part of the C++ standard).
A compiler extension is by definition non-standard.