https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105742
Bug ID: 105742
Summary: accepts-invalid non-dependent call to non-static
member function from unrelated class in presence of
dependent base
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ppalka at gcc dot gnu.org
Target Milestone: ---
struct X {
void g();
};
struct Y { };
template<class T>
struct A : T {
void f() {
using type = decltype(X::g());
}
};
template struct A<Y>;
The call to the non-static X::g should be rejected at instantiation time
because X isn't a base of A<Y>, but instead we resolve the decltype at template
definition time and accept the testcase because we (incorrectly?) deem the call
to be non type dependent (and non instantiation dependent).