gcc/testsuite/g++.dg/cpp0x/auto36.C
raw| 1 | // PR c++/54903 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<int N, int D> |
| 5 | struct Modulus |
| 6 | { |
| 7 | static auto const value = N % D; |
| 8 | }; |
| 9 | |
| 10 | template<int N> |
| 11 | struct Angle |
| 12 | { |
| 13 | static auto const value = Modulus<N, 360>::value; // ERROR |
| 14 | //static int const value = Modulus<N, 360>::value; // OK |
| 15 | //static auto const value = N % 360; // OK |
| 16 | |
| 17 | typedef Angle<value> type; |
| 18 | }; |