From: Paolo Carlini Date: Thu, 19 Mar 2015 08:57:01 +0000 (+0000) Subject: re PR c++/59686 (Non-constexpr pointers accepted in constant expressions) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9308995b0acf2f8bbfdbc63d3f950494388f6fa8;p=gcc.git re PR c++/59686 (Non-constexpr pointers accepted in constant expressions) 2015-03-19 Paolo Carlini PR c++/59686 * g++.dg/cpp0x/constexpr-59686.C: New. From-SVN: r221510 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 756baf3847e..378fba23cf2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-19 Paolo Carlini + + PR c++/59686 + * g++.dg/cpp0x/constexpr-59686.C: New. + 2015-03-19 Jakub Jelinek PR sanitizer/64265 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-59686.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-59686.C new file mode 100644 index 00000000000..89362145629 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-59686.C @@ -0,0 +1,9 @@ +// PR c++/59686 +// { dg-do compile { target c++11 } } + +int main() +{ + static const int x = 5; + const int * const y = &x; + static_assert(y, ""); // { dg-error "non-constant|value" } +}