gcc/testsuite/g++.dg/template/pr84789-2.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | struct K { |
| 4 | struct L { |
| 5 | static double j; |
| 6 | }; |
| 7 | }; |
| 8 | |
| 9 | template <typename T> |
| 10 | struct M { |
| 11 | struct N { |
| 12 | static int i; |
| 13 | }; |
| 14 | }; |
| 15 | |
| 16 | template <typename T> |
| 17 | struct O { |
| 18 | typedef M<T> P; |
| 19 | typedef K Q; |
| 20 | }; |
| 21 | |
| 22 | template <typename T> |
| 23 | int O<T>::P::N::i = 42; // This is obfuscated, but apparently ok. |
| 24 | |
| 25 | template <typename T> |
| 26 | double O<T>::Q::L::j = 42.0; // { dg-error "non-template" } |