Description
The following code generates no warnings in Clang despite the override's return type being incorrect:
struct S {
virtual const void* f() = 0;
virtual ~S() = default; // Silence -Wnon-virtual-dtor
};
struct T : S {
void* f() override; // Should warn or error
};
Other compilers:
gcc: Warns
MSVC: Errors
Live example: https://godbolt.org/z/TjoxEzd7M
Larger example demonstrating dispatch in the presence of overloads: https://godbolt.org/z/orcfbrnGz