Hi Jakub, On 20 Jan 2025, at 10:28, Simon Martin wrote:
> Hi Jakub, > > On 20 Jan 2025, at 10:15, Jakub Jelinek wrote: > >> On Mon, Jan 20, 2025 at 08:52:17AM +0000, Simon Martin wrote: >>> On 12 Jan 2025, at 12:10, Simon Martin wrote: >>> >>>> 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. >> >> Is that the only testcase that regresses with -fimplicit-constexpr? >> I'd expect tons of others... > Actually yes, I test all my patches with check-c++-all and this is the > only case that fails in that mode and does not with standard make > check. > >>>> This patch adapts the test to also pass with -fimplicit-constexpr. >>>> >>>> Successfully tested on x86_64-apple-darwin19.6.0 with >>>> make check-c++-all RUNTESTFLAGS="dg.exp=constexpr-asm-5.C" >>> Ping? This is borderline obvious but since I’ve never played with >>> inline assembly, I’d appreciate a second pair of eyes. >> >> Wouldn't it be easier to just add -fno-implicit-constexpr to >> dg-additional-options? > That would work indeed, and it’s true that it’s probably more in > the > spirit of that test. I’m happy to do that instead - I’ll do > another > testsuite run with that and I can merge it later today if that works > for > you. Here’s the updated patch, successfully tested on x86_64-pc-linux-gnu with “make check-c++-all”. OK? Thanks, Simon
From eccf73af1b3555be3e02ea2f3b1ca0be32c81cc1 Mon Sep 17 00:00:00 2001 From: Simon Martin <si...@nasilyan.com> Date: Mon, 20 Jan 2025 20:30:59 +0100 Subject: [PATCH] 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. Successfully tested on x86_64-pc-linux-gnu with "make check-c++-all". gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-asm-5.C: Pass -fno-implicit-constexpr. --- gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C index 1c20b9dfec1..bcecea9d6b5 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; }; -- 2.44.0