diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-47570.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-47570.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-47570.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-47570.C new file mode 100644 index 0000000..263a44b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-47570.C @@ -0,0 +1,25 @@ +// PR c++/47570 +// { dg-do compile { target c++11 } } + +unsigned int constexpr one() +{ return 1; } + +int constexpr one_B() +{ return 1; } + +int main() +{ + // FAIL TO COMPILE: + static bool constexpr SC_huh1 = ((unsigned int)one()) >= ((unsigned int)0); + static bool constexpr SC_huh2 = one() >= ((unsigned int)0); + static bool constexpr SC_huh3 = one() >= 0; + + // COMPILE OK: + static bool constexpr SC_huh4 = ((one() == 0) || (one() > 0)); + static bool constexpr SC_huh5 = one() == 0; + static bool constexpr SC_huh6 = one() > 0; + static bool constexpr SC_huh7 = one_B() >= 0; + static bool constexpr SC_huh8 = one() >= 1; + + return SC_huh3; +} |