https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126606

            Bug ID: 126606
           Summary: [16 Regression] gcc-17 fails to build qt-6.11.1:
                    qfutureinterface_p.h:150:25: error: call to
                    'QFutureInterfaceBasePrivate::RefCount::RefCount(int,
                    int)' uses the default argument for parameter 2, which
                    is not yet defined
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Did not bisect yet. Saw the failure on r17-2878-g6bf6dad5347663 when building
qt-6.11.1 around 
https://codebrowser.dev/qt6/qtbase/src/corelib/thread/qfutureinterface_p.h.html#QFutureInterfaceBasePrivate::refCount
as :

In file included from
/tmp/b/qtbase-everywhere-src-6.11.1/src/corelib/thread/qfutureinterface.cpp:7:
/tmp/b/qtbase-everywhere-src-6.11.1/src/corelib/thread/qfutureinterface_p.h:150:25:
error: call to 'QFutureInterfaceBasePrivate::RefCount::RefCount(int, int)' uses
the default argument for parameter 2, which is not yet defined
  150 |     RefCount refCount = 1;
      |                         ^

pinskia suspects it's related to PR126481 and came up with the following
extracted case:

struct s1 {
  struct s2
  {
    s2(int a = 0, int b = 1){}
  };
  s2 a = 1;
};


$ g++-16 -c a.cc
# works

$ gcc/xg++ -Bgcc -c a.cc
a.cc:6:10: error: call to ‘s1::s2::s2(int, int)’ uses the default argument for
parameter 2, which is not yet defined
    6 |   s2 a = 1;
      |          ^

$ gcc/xg++ -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xg++
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer
--enable-languages=c,c++ CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260802 (experimental) (GCC)

Reply via email to