From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0D533858403; Sun, 16 Oct 2022 14:42:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0D533858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665931349; bh=QZdWUkxBRMWqgzINvLuWlkKpsSn3SlrB94FYNnTmM/0=; h=From:To:Subject:Date:From; b=viSI40QVjVl4XMqdCi7lgGLW3xVvy5S6jFES0DSiHMi6QNb4Da0wws8ZWY0KrzkVY L3ySw9tUI3u7Zx+URFqoQE3OVByIDbBG+oIEA1SeaUlRmBaoPjgJTlYhfhm++nPoEj MF44ZKSc8JdUo0YSwkK1FqAhCxC6kocptZGhnIrU= From: "ky4ct at arrl dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107278] New: fails to correctly parse template default function declarations. Date: Sun, 16 Oct 2022 14:42:28 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ky4ct at arrl dot net 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 attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107278 Bug ID: 107278 Summary: fails to correctly parse template default function declarations. Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ky4ct at arrl dot net Target Milestone: --- Created attachment 53709 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53709&action=3Dedit minimal source code to reproduce the error. This is specific to the -std=3DC++20 and -std=3DC++2b switches. The followi= ng compiles fine by default and under C++ 11 and 14. kd5eax@KY4CT UCRT64 ~ $ cat test.cpp template class foo { foo(foo const&) =3D delete; foo(foo const&&) =3D default; }; int main() { return 0; }; kd5eax@KY4CT UCRT64 ~ $ g++ -std=3Dc++20 test.cpp test.cpp:4:22: error: expected ')' before 'const' 4 | foo(foo const&) =3D delete; | ~ ^~~~~~ | ) test.cpp:5:22: error: expected ')' before 'const' 5 | foo(foo const&&) =3D default; | ~ ^~~~~~ | ) kd5eax@KY4CT UCRT64 ~ $ g++ -v Using built-in specs. COLLECT_GCC=3DE:\msys64\ucrt64\bin\g++.exe COLLECT_LTO_WRAPPER=3DE:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12= .2.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../gcc-12.2.0/configure --prefix=3D/ucrt64 --with-local-prefix=3D/ucrt64/local --build=3Dx86_64-w64-mingw32 --host=3Dx86_64-w64-mingw32 --target=3Dx86_64-w64-mingw32 --with-native-system-header-dir=3D/ucrt64/include --libexecdir=3D/ucrt64/lib --enable-bootstrap --enable-checking=3Drelease --with-arch=3Dx86-64 --with-tune=3Dgeneric --enable-languages=3Dc,lto,c++,fortran,ada,objc,obj-c= ++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=3Dposix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=3D/ucrt64 --with-mpfr=3D/ucrt64 --with-mpc=3D/ucrt64 --with-isl=3D/ucrt64 --with-pkgversion=3D'Rev1, Built by MSYS2 project' --with-bugurl=3Dhttps://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --with-boot-ldflags=3D-static-libst= dc++ --with-stage1-ldflags=3D-static-libstdc++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Rev1, Built by MSYS2 project)=