From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 834863858C56; Fri, 14 Oct 2022 01:40:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 834863858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665711641; bh=BVRHRQxW9V+vAM+C7CrkrKHkBdv3G89aXZSJe3Utu8I=; h=From:To:Subject:Date:From; b=ssJ+B8Ma4KJTyUcEclYjpkuUuxCzLIPLk9nLuxHsJBZZGLD1yNwb/+US8qxNDiJg3 iXb2ieXkwWTT1XvIDIpjL9FSzx3enk4KzKZfejKk8H5OO4jfnPUEC7/gBvodGCOAtZ udICl6pHjrmMsFML6gel6mS0eXMa9do8Xw+l2aSQ= From: "enolan at alumni dot cmu.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107255] New: ation and definition of a template function which vary in use of concept auto syntax are interpreted as ambiguous overloadsdeclar Date: Fri, 14 Oct 2022 01:40:39 +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: enolan at alumni dot cmu.edu 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107255 Bug ID: 107255 Summary: ation and definition of a template function which vary in use of concept auto syntax are interpreted as ambiguous overloadsdeclar Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: enolan at alumni dot cmu.edu Target Milestone: --- This is a rejects-valid bug where GCC has trouble determining that a declaration and definition which vary only in their use of concept auto syn= tax are for the same function and not multiple ambiguous overloads. Compiler explorer link: https://godbolt.org/z/4Tjcz49d9 Minimal reproduction: template concept Foo =3D true; void bar(Foo auto); template void bar(F) {} void baz() { bar(0); } > the exact version of GCC gcc version 12.2.1 20220819 (Red Hat 12.2.1-2) (GCC) > the system type Fedora release 38 (Rawhide) > the options given when GCC was configured/built Configured with: ../configure --enable-bootstrap --enable-languages=3Dc,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=3D/usr --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttp://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=3Dposix --enable-checking=3Drelease --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=3Dgnu --enable-plugin --enable-initfini-array --with-isl=3D/builddir/build/BUILD/gcc-12.2.1-20220819/obj-x86_64-redhat-li= nux/isl-install --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=3Dgeneric --with-arch_32=3Di686 --build=3Dx86_64-redhat-linux --with-build-config=3Dbootstrap-lto --enable-link-serialization=3D1 > the complete command line that triggers the bug g++ -std=3Dc++20 poc.cpp > the compiler output poc.cpp: In function =E2=80=98void baz()=E2=80=99: poc.cpp:10:8: error: call of overloaded =E2=80=98bar(int)=E2=80=99 is ambig= uous 10 | bar(0); | ~~~^~~ poc.cpp:4:6: note: candidate: =E2=80=98void bar(auto:1) [with auto:1 =3D in= t]=E2=80=99 4 | void bar(Foo auto); | ^~~ poc.cpp:7:6: note: candidate: =E2=80=98void bar(F) [with F =3D int]=E2=80=99 7 | void bar(F) {} | ^~~=