https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114804
Bug ID: 114804 Summary: rejects valid code Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: wdehnen64 at gmail dot com Target Milestone: --- gcc fails to compile the following ===test.cc=== template<int D> struct blurb { constexpr static int d=D; }; template<typename> struct pant { int foo=0; }; template<typename Base> struct bug : Base { using base = Base; using base::d; using tool = blurb<d>; struct problem : pant<tool> { using pant<tool>::foo; }; void bar() const { problem b; } }; template struct bug< blurb<2> >; ===Terminal=== > gcc-13 src/bug.cc -c src/bug.cc: In instantiation of 'struct bug<blurb<2> >::problem': src/bug.cc:17:17: required from here src/bug.cc:13:12: error: 'd' was not declared in this scope 13 | struct problem : pant<tool> { using pant<tool>::foo; }; | ^~~~~~~ src/bug.cc:13:53: error: type 'pant<blurb<2> >' is not a base type for type 'bug<blurb<2> >::problem' 13 | struct problem : pant<tool> { using pant<tool>::foo; }; | ^~~ ===Note=== last version known to be correct: gcc-10.5.0 (gcc-11, gcc-12 also fail) ===Version=== > g++-13 -v Using built-in specs. COLLECT_GCC=g++-13 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/13.2.0/bin/../libexec/gcc/x86_64-apple-darwin23/13/lto-wrapper Target: x86_64-apple-darwin23 Configured with: ../configure --prefix=/usr/local/opt/gcc --libdir=/usr/local/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-13 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-zstd=/usr/local/opt/zstd --with-pkgversion='Homebrew GCC 13.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=x86_64-apple-darwin23 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.0 (Homebrew GCC 13.2.0)