From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39526385C426; Tue, 24 Mar 2020 19:51:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39526385C426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585079502; bh=DvCUunzeLRcdzOh9Fw6H/KPC0vTQXoqSSkFmLAaaZwA=; h=From:To:Subject:Date:From; b=xAd2Gr8L1qvMrmmOGzSN4zGRHOFxj0Fzon8h477+tTLDCLt3mSZoxNjkdDBS4z9ug LVomKTsu+1RGmfU9DWbs/ItEiiJcCwDgxEIQDJYy+x0HsX0KtgCnuq7Viz92S1n0qx 5/WuuDfW9c4QirQYHIVy3u3w6/bViTSUWaGSurLI= From: "tilin97 at yandex dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94310] New: using constructor inheritance breaks the code Date: Tue, 24 Mar 2020 19:51:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tilin97 at yandex dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2020 19:51:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94310 Bug ID: 94310 Summary: using constructor inheritance breaks the code Product: gcc Version: 9.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tilin97 at yandex dot ru Target Milestone: --- The following code is compiled without errors template struct B { }; template struct A : public B... { using B::operator=3D...; using B::B...; }; int main() {} But when you change the order of using declarations compilation fails (the = same error occurs in all versions of gcc on godbolt.org) template struct B { }; template struct A : public B... { using B::B...; <--- using B::operator=3D...; <--- }; int main() {} gcc -v -std=3Dc++17 -Wall -Wextra main.cpp Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none:hsa OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 9.2.1-17ubuntu1~18.04.1' --with-bugurl=3Dfile:///usr/share/doc/gcc-9/README= .Bugs --enable-languages=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix= =3D/usr --with-gcc-major-version-only --program-suffix=3D-9 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-clocale=3Dgnu --enable-libstdcxx-= debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=3Dauto --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --with-arch-32= =3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --enable-offload-targets=3Dnvptx-none,hsa --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu Thread model: posix gcc version 9.2.1 20191102 (Ubuntu 9.2.1-17ubuntu1~18.04.1)=20 COLLECT_GCC_OPTIONS=3D'-v' '-std=3Dc++17' '-Wall' '-Wextra' '-mtune=3Dgener= ic' '-march=3Dx86-64' /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux= -gnu -D_GNU_SOURCE main.cpp -quiet -dumpbase main.cpp -mtune=3Dgeneric -march=3D= x86-64 -auxbase main -Wall -Wextra -std=3Dc++17 -version -fasynchronous-unwind-tab= les -fstack-protector-strong -Wformat-security -o /tmp/ccVHNdqy.s GNU C++17 (Ubuntu 9.2.1-17ubuntu1~18.04.1) version 9.2.1 20191102 (x86_64-linux-gnu) compiled by GNU C version 9.2.1 20191102, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9" ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/9 /usr/include/x86_64-linux-gnu/c++/9 /usr/include/c++/9/backward /usr/lib/gcc/x86_64-linux-gnu/9/include /usr/local/include /usr/lib/gcc/x86_64-linux-gnu/9/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. GNU C++17 (Ubuntu 9.2.1-17ubuntu1~18.04.1) version 9.2.1 20191102 (x86_64-linux-gnu) compiled by GNU C version 9.2.1 20191102, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 33caeb1da5df6f896d4e495951c13eae main.cpp:8:11: error: expected nested-name-specifier before =E2=80=98B=E2= =80=99 8 | using B::operator=3D...; | ^ ----------------------------- The following code is also compiled with an error if there is no comment template struct B { void foo() {} }; template struct A : public B... { // using B::B...; <--- void bar() { (B::foo() , ...); } }; int main() {} gcc -std=3Dc++17 -Wall -Wextra b.cpp b.cpp: In member function =E2=80=98void A::bar()=E2=80=99: b.cpp:11:11: error: expected primary-expression before =E2=80=98>=E2=80=99 = token 11 | (B::foo() , ...); | ^ b.cpp:11:14: error: =E2=80=98::foo=E2=80=99 has not been declared 11 | (B::foo() , ...); | ^~~ b.cpp:11:11: error: binary expression in operand of fold-expression 11 | (B::foo() , ...); | ~~~~~~~^~~~~~~~ b.cpp:11:11: error: operand of fold expression has no unexpanded parameter packs=