diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C new file mode 100644 index 000000000..20e05c3c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C @@ -0,0 +1,16 @@ +// PR c++/47200 +// { dg-options "-std=c++0x -w" } + +template < int > struct duration +{ + constexpr int count (); + static constexpr duration min (); +}; + +constexpr int +f (duration < 0 > d, duration < 0 > ) +{ + return d.count (); +} + +static_assert (f (duration < 0 >::min (), duration < 0 > ()), ""); // { dg-error "non-constant|before its definition" } |