From 9308995b0acf2f8bbfdbc63d3f950494388f6fa8 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 19 Mar 2015 08:57:01 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-59686.C | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-59686.C 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" } +} -- 2.30.2