| 1 |
// PR c++/93870 - wrong error when converting template non-type arg. |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template <typename ENUM> struct EnumWrapper |
| 5 |
{ |
| 6 |
ENUM value; |
| 7 |
|
| 8 |
constexpr operator ENUM() const |
| 9 |
{ |
| 10 |
return value; |
| 11 |
} |
| 12 |
}; |
| 13 |
|
| 14 |
enum E : int { V }; |
| 15 |
|
| 16 |
constexpr EnumWrapper<E> operator ~(E a) |
| 17 |
{ |
| 18 |
return {E(~int(a))}; |
| 19 |
} |
| 20 |
|
| 21 |
template <E X> struct R |
| 22 |
{ |
| 23 |
static void Func(); |
| 24 |
}; |
| 25 |
|
| 26 |
template <E X> struct S : R<~X> |
| 27 |
{ |
| 28 |
}; |
| 29 |
|
| 30 |
void Test() |
| 31 |
{ |
| 32 |
S<E::V>::Func(); |
| 33 |
} |