view gcc/testsuite/g++.dg/template/lookup13.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// PR c++/94799 - member template function lookup fails.

template <typename T>
struct A {
    int a() {
        return 42;
    }

    template<typename> struct X { typedef int type; };
};

template <typename T>
struct B {
    int b(A<T> *p) {
	int i = 0;
        i += p->a();
        i += p->template A<T>::a();
        i += p->template A<T>::template A<T>::a();
	i += A<T>().template A<T>::a();
	return i;
    }
};

int main() {
    A<int> a;
    B<int> b;
    return b.b(&a);
}