Please consider a struct A with a method f, and an inherited struct B, which does not redefine f. In this case B::f refers to the same method as A::f.
Is it allowed to invoke the method f of an A object using B::f name as in the following example?
struct A { void f() {} };
struct B : A {};
int main() { A{}.B::f(); }
Clang and GCC diverge here. Clang is fine with the program, while GCC prints the error:
error: 'B' is not a base of 'A'
demo: https://gcc.godbolt.org/z/Pn7jehzdP
Which compiler is right here according to the standard?