Debian Codegraph @

gcc/testsuite/g++.dg/template/lookup16.C

raw
1 // PR c++/94799
2 // { dg-do compile { target c++11 } }
3
4 template <typename> struct A {
5 typedef int type;
6 operator int();
7 };
8
9 template <typename T> using B = A<T>;
10
11 template <typename T> typename B<T>::type foo(B<T> b)
12 {
13 auto r1 = b.operator typename A<T>::type();
14 auto r2 = b.operator typename A<T>::template A<T>::type();
15 auto r3 = b.operator typename B<T>::type();
16 auto r4 = b.operator typename B<T>::template A<T>::type();
17 return r1 + r2 + r3 + r4;
18 }
19
20 void bar()
21 {
22 foo(A<int>());
23 }