diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-array12.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-array12.C | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array12.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array12.C new file mode 100644 index 0000000000..ec81fffd87 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array12.C @@ -0,0 +1,33 @@ +// PR c++/65876 +// { dg-do compile { target c++11 } } + +template<int> +struct duration +{ + constexpr duration() : r(0) {} + + template<int TPeriod> + constexpr duration(duration<TPeriod> x) : r(x.count()) {} + + constexpr int count() { return 0; } + + int r; +}; + +struct Config { + duration<1> timeout { duration<2>() }; +}; + +Config make_config() +{ + return {}; +} + +struct ConfigArray { + ConfigArray(); + Config all_configs[1]; +}; + +ConfigArray::ConfigArray() +{ +} |