On Wed, Nov 19, 2025 at 03:49:28PM +0100, Daniele Sahebi wrote:
> > --- /dev/null
> > +++ b/gcc/testsuite/g++.dg/pr122658.C
> > @@ -0,0 +1,15 @@
> > +/* PR c++/53055 */
> Well I just noticed this is wrong.
> I was looking around the other tests to see what they were doing and
> that must have slipped in then...
When you touch it, besides using correct PR number in there, most C++
tests use // comments in the header, and
>
> Do I send another patch in this case?
> > +/* { dg-do compile } */
> > +/* { dg-options "-std=c++20" } */
should be really
// { dg-do compile { target c++20 } }
and no dg-options, that way it can be tested in all of C++20, C++23 and
C++26 modes currently (and perhaps further ones in the future).
And, gcc/testsuite/g++.dg/ directory better shouldn't contain any tests,
so better put it into gcc/testsuite/g++.dg/cpp2a/consteval42.C or so.
I think it wouldn't hurt to also instantiate the template later in the test,
like with
template <typename T>
S
foo ()
{
constexpr auto s = S::bar ();
return s;
}
S
bar ()
{
return foo <int> ();
}
Also, if you are submitting this under DCO, you should read
https://gcc.gnu.org/dco.html and add your Signed-Off-By line.
Or otherwise it needs to be assigned to FSF and that needs to be
arranged first.
Jakub