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
This commit is contained in:
parent
e51fbec3ff
commit
0761f6bfb3
2 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-09-14 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/77539
|
||||
* g++.dg/cpp1y/pr77539.C: New.
|
||||
|
||||
2016-09-14 Christophe Lyon <christophe.lyon@linaro.org>
|
||||
|
||||
* g++.dg/cpp0x/lambda/lambda-mangle.C: Move dg-do directive before
|
||||
|
|
14
gcc/testsuite/g++.dg/cpp1y/pr77539.C
Normal file
14
gcc/testsuite/g++.dg/cpp1y/pr77539.C
Normal file
|
@ -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(),"");
|
Loading…
Add table
Reference in a new issue