The nios2-elf target defaults to -fno-delete-null-pointer-checks, at the request of Altera; they wanted to be able to manipulate pointers to memory at address zero. From time to time I find new tests that have an implicit dependence on -fdelete-null-pointer-checks, which I've been fixing for this target by making the option explicit on those tests.

FWIW, for these tests I was seeing a compilation error like "e != 0 is not a constant expression".

-Sandra

2019-01-22  Sandra Loosemore  <san...@codesourcery.com>

	gcc/testsuite/
	* g++.dg/cpp0x/pr86397-1.C: Add -fdelete-null-pointer-checks.
	* g++.dg/cpp0x/pr86397-2.C: Likewise.
Index: gcc/testsuite/g++.dg/cpp0x/pr86397-1.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/pr86397-1.C	(revision 268160)
+++ gcc/testsuite/g++.dg/cpp0x/pr86397-1.C	(working copy)
@@ -1,4 +1,5 @@
 // { dg-do compile { target c++11 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 void e();
 template <bool> void f(int() noexcept(e)) {}
 template void f<false>(int()); // { dg-error "does not match" "" { target c++17 } }
Index: gcc/testsuite/g++.dg/cpp0x/pr86397-2.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/pr86397-2.C	(revision 268160)
+++ gcc/testsuite/g++.dg/cpp0x/pr86397-2.C	(working copy)
@@ -1,4 +1,5 @@
 // { dg-do compile { target c++11 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 void e();
 template <bool> void f(int() noexcept(e)) {}
 template void f<false>(int() noexcept);

Reply via email to