From: Simon Martin Date: Tue, 21 Jan 2025 09:11:12 +0000 (+0100) Subject: testsuite: Fix test failing with -fimplicit-constexpr [PR118277] X-Git-Tag: basepoints/gcc-16~2462 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3d884da1280e211f48be0619e5d2f1ee7eeee87;p=thirdparty%2Fgcc.git testsuite: Fix test failing with -fimplicit-constexpr [PR118277] While testing an unrelated C++ patch with "make check-c++-all", I noticed that r15-6760-g38a13ea4117b96 added a test case that fails with -fimplicit-constexpr. The problem is that this test unconditionally expects an error stating that a non-constexpr function is called, but that function is auto-magically constexpr'd under -fimplicit-constexpr. As suggested by Jakub, this patch simply passes -fno-implicit-constexpr in that test. PR c++/118277 gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-asm-5.C: Pass -fno-implicit-constexpr. --- diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C index 1c20b9dfec1e..bcecea9d6b50 100644 --- a/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C @@ -2,7 +2,7 @@ // { dg-do compile { target c++11 } } // { dg-options "" } // Override any default-'-fno-exceptions': -// { dg-additional-options -fexceptions } +// { dg-additional-options "-fexceptions -fno-implicit-constexpr" } struct A {}; struct B { int size; };