On Mon, Sep 08, 2025 at 10:27:32AM +0200, Jakub Jelinek wrote:
> On Sat, Sep 06, 2025 at 03:54:31PM +1000, Nathaniel Shead wrote:
> >     * g++.dg/modules/default-arg-4_a.C: XFAIL bogus errors.
> >     * g++.dg/modules/default-arg-4_b.C: Likewise.
> > --- a/gcc/testsuite/g++.dg/modules/default-arg-4_a.C
> > +++ b/gcc/testsuite/g++.dg/modules/default-arg-4_a.C
> > @@ -17,3 +17,7 @@ qux ()
> >  {
> >    return foo () + bar <int> () + baz <int> ();
> >  }
> > +
> > +export using ::foo;
> > +export using ::bar;
> > +export using ::baz;
> > diff --git a/gcc/testsuite/g++.dg/modules/default-arg-4_b.C 
> > b/gcc/testsuite/g++.dg/modules/default-arg-4_b.C
> > index 98b3a5f4ba7..7ed003ff398 100644
> > --- a/gcc/testsuite/g++.dg/modules/default-arg-4_b.C
> > +++ b/gcc/testsuite/g++.dg/modules/default-arg-4_b.C
> > @@ -1,23 +1,23 @@
> >  // C++20 P1766R1 - Mitigating minor modules maladies
> > -// { dg-do run }
> > +// { dg-module-do run }
> >  // { dg-additional-options "-fmodules-ts" }
> >  
> >  import M;
> >  
> >  int
> > -foo (int i = 42)
> > +foo (int i = 42)                   // { dg-bogus "default argument given 
> > for parameter 1 of 'int foo\\\(int\\\)'" "PR99000" { xfail *-*-* } }
> >  {
> >    return i;
> >  }
> >  
> > -template <typename T, typename U = int>
> > +template <typename T, typename U = int>    // { dg-bogus "redefinition of 
> > default argument for 'class U'" "PR99000" { xfail *-*-* } }
> >  int
> >  bar ()
> >  {
> >    return sizeof (U);
> >  }
> >  
> > -template <typename T, int N = 42>
> > +template <typename T, int N = 42>  // { dg-bogus "redefinition of default 
> > argument for 'int N'" "PR99000" { xfail *-*-* } }
> >  int
> >  baz ()
> >  {
> 
> I'm getting
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++17 execute
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++17 link
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++20 execute
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++20 link
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++23 execute
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++23 link
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++26 execute
> UNRESOLVED: g++.dg/modules/default-arg-4 -std=c++26 link
> because of this.  The error messages (even with xfailed dg-bogus)
> mean the compilation fails, so linking nor running isn't done.
> So at least temporarily the test should be dg-do compile (dunno what
> dg-module-do does, maybe dg-module-do compile) until the errors are
> fixed.
> 
>       Jakub
> 

Oh, sorry!  Is there a way to get the output of 'make check' to complain
about this more obviously?  I just got a "# of unresolved testcases:"
which I didn't notice as an issue.  (But I can pay attention for that
now...)

Re dg-module-do vs dg-do, dg-module-do will ensure that for module
tests with multiple TUs we actually link all the TUs rather than just
the one we put { dg-do run } on, I believe.

Here's a fix I'll push in a little while unless anyone has concerns.
Tested on x86_64-pc-linux-gnu, will commit as obvious.

-- >8 --

Subject: [PATCH] testsuite: Fix UNRESOLVEDs for mistakenly dg-run test
 [PR121872]

gcc/testsuite/ChangeLog:

        * g++.dg/modules/default-arg-4_b.C: Change run to compile.

Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>
---
 gcc/testsuite/g++.dg/modules/default-arg-4_b.C | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/modules/default-arg-4_b.C 
b/gcc/testsuite/g++.dg/modules/default-arg-4_b.C
index 7ed003ff398..5800ea20807 100644
--- a/gcc/testsuite/g++.dg/modules/default-arg-4_b.C
+++ b/gcc/testsuite/g++.dg/modules/default-arg-4_b.C
@@ -1,5 +1,6 @@
 // C++20 P1766R1 - Mitigating minor modules maladies
-// { dg-module-do run }
+// FIXME mark as run once we no longer xfail below.
+// { dg-module-do compile }
 // { dg-additional-options "-fmodules-ts" }
 
 import M;
-- 
2.51.0

Reply via email to