From: Nathan Sidwell Date: Wed, 14 Sep 2016 16:13:52 +0000 (+0000) Subject: re PR c++/77539 (gcc-5/6: comparison of array to nullptr failure in constexpr (fixed... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0761f6bfb315e6dd471ac62024e0703345c7ab47;p=gcc.git re PR c++/77539 (gcc-5/6: comparison of array to nullptr failure in constexpr (fixed by r235506 on trunk)) PR c++/77539 * g++.dg/cpp1y/pr77539.C: New. From-SVN: r240138 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 636f031b3db..e394dcd92f5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-14 Nathan Sidwell + + PR c++/77539 + * g++.dg/cpp1y/pr77539.C: New. + 2016-09-14 Christophe Lyon * g++.dg/cpp0x/lambda/lambda-mangle.C: Move dg-do directive before diff --git a/gcc/testsuite/g++.dg/cpp1y/pr77539.C b/gcc/testsuite/g++.dg/cpp1y/pr77539.C new file mode 100644 index 00000000000..d1fba24c625 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr77539.C @@ -0,0 +1,14 @@ +// PR c++/77539 +// { dg-do compile { target c++14 } } + +constexpr int foobar() +{ + int array[100] = {}; + int *ar = array; + if (ar == nullptr) // Error... + { + return 0; + } + return 1; +} +static_assert(foobar(),"");