From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C73C386482F; Fri, 3 Sep 2021 07:07:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C73C386482F From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102184] Explicit template instantiation thinks there is an ambiguous template specialization when there is none for concepts Date: Fri, 03 Sep 2021 07:07:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed bug_status cf_reconfirmed_on keywords short_desc Message-ID: In-Reply-To: References: 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: Fri, 03 Sep 2021 07:07:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102184 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2021-09-03 Keywords| |rejects-valid Summary|Explicit template |Explicit template |instantiation is wrongly |instantiation thinks there |considered as |is an ambiguous template |specialization |specialization when there | |is none for concepts --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > GCC is saying there is an ambigous specialization. >=20 > If I do this, GCC accepts the code: > template requires(N=3D=3D1) int fib() { return 1; } > template requires(N=3D=3D2) int fib() { return 1; } > template int fib() requires(N!=3D1 && N!=3D2) { return fib()= + > fib(); } > template int fib<1>(); But I think GCC does not know which specialization to instantiate here. Because the following works just fine: int t =3D fib<1>();=