Victor said:
What would the result of such compilation be? Undefined?
Up to the implementor. It has nothing to do with the standard's notion
of undefined behavior.
Let's back up a bit -- this is a common area for confusion:
The standard says that compilers that claim to conform to the standard
must compile well-formed programs, and it specifies what the behavior of
such programs is. That behavior isn't necessarily unique, because some
aspects of the language are implementation-defined (such a construct is
valid, and the implementation must document what it does -- for example,
whether char is signed or unsigned is implementation-defined, so testing
whether a char value is less than zero might always yield false) and
some are unspecified (such a construct is valid, but the implementation
is not required to document what it does -- for example, the order of
evaluation of function arguments is unspecified).
Then there are programs that are ill-formed, that is, they violate the
rules that the standard lays down for well-formed programs. For some of
these rules the behavior is simply undefined: the compiler can do
anything, and isn't required to tell you what it did or even that you
broke the rules (i=i++, for example). For most of the rules a diagnostic
is required. Having given a diagnostic, the compiler has told you that
the rules for standard C++ no longer apply; it is then free to do
anything, without violating the standard. That's the hook for conforming
extensions -- take something that's otherwise invalid and do something
meaningful with it. Microsoft's __declspec stuff, and GNU's
__attribute__ stuff, are examples of this: they occur in places where
such things aren't allowed, so the compiler is required to issue a
diagnostic; after doing this, these compilers change how they compile
the surrounding code (you don't usually see these warnings because you
run the compiler in a mode that disables them).
In the example at hand there's no obvious sensible extension behavior,
so chances are the result will actually be a refusal to compile the
code. But that's not because the standard requires it.