| 1 |
// PR c++/55931 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
#include <type_traits> |
| 5 |
|
| 6 |
template<typename Type> |
| 7 |
class Test |
| 8 |
{ |
| 9 |
public: |
| 10 |
constexpr Test(const Type val) : _value(val) {} |
| 11 |
constexpr Type get() const {return _value;} |
| 12 |
static void test() |
| 13 |
{ |
| 14 |
static constexpr Test<int> x(42); |
| 15 |
std::integral_constant<int, x.get()> i; // This is not working |
| 16 |
} |
| 17 |
protected: |
| 18 |
Type _value; |
| 19 |
}; |
| 20 |
|
| 21 |
int main() |
| 22 |
{ |
| 23 |
static constexpr Test<int> x(42); |
| 24 |
std::integral_constant<int, x.get()> i; // This is working |
| 25 |
Test<double>::test(); |
| 26 |
} |