Do you think that the initialized declarator is a valid lexical structure inside of the caught-declaration part of the catch statement? For example, take a look at the following code:
void func( int = 1 )
{
try
{
}
catch( int a = 1 )
{
}
}
It compiles fine under latest MSVC 17.0.2 but fails to compile under latest GCC 11.2 (tested using Godbolt.org). I want to know the answer to form a purely lexical understanding about the correct typing of C++ code.
If you read this cppreference.com article then you find that it says that the declaration should be exactly the same as(*) for function signature arguments, thus putting legitimacy into the MSVC C++ lexer.
* It's not actually the same. The text just happens to distinguish between just a declarator and the initializer part being separate.