Override one virtual function multiple times in C++

The code below does not compile in C++: MSVC error: The code below compiles with MSVC: but GCC fails to compile this code with the following error: