gcc/testsuite/g++.dg/template/non-dependent8.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Origin: Giovanni Bajo <[email protected]> |
| 4 | |
| 5 | // Two-phase name lookup for address of member: |
| 6 | // Detecting error during parsing |
| 7 | |
| 8 | struct S |
| 9 | { |
| 10 | char i; |
| 11 | }; |
| 12 | |
| 13 | template<int S::*p> |
| 14 | struct X |
| 15 | {}; |
| 16 | |
| 17 | template <class T> |
| 18 | struct Foo |
| 19 | { |
| 20 | X<&S::i> x; // { dg-error "5:could not convert" "" { target c++17 } } |
| 21 | // { dg-error "could not convert" "" { target c++14_down } .-1 } |
| 22 | }; |