From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F090038515E3; Thu, 25 Mar 2021 11:35:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F090038515E3 From: "StevenSun2021 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99686] ICE when using both concepts and full specialization Date: Thu, 25 Mar 2021 11:35:13 +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: 10.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: StevenSun2021 at hotmail dot com 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: 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: Thu, 25 Mar 2021 11:35:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99686 --- Comment #3 from Steven Sun --- @W E Brown: I got your idea. So are all uses like this ill-formed? This see= ms unexpected for me. I would expect the complete specialization is full specialization for both primary templates. I also find facts that support your idea: If I modify the full specialization to=20 -------------------- template <> void func (int&& arg){} -------------------- It compiles. See https://godbolt.org/z/fh9Mx7Krr If I modify the full specialization to=20 -------------------- template <> void func (int&& arg){} -------------------- It produce the same ICE output as comment 1. See https://godbolt.org/z/eMa5YcrrE It looks like the compiler doesn't knows which primary template to speciali= ze. I look up in the C++20 standard, and did not find anything about 2 primary templates exists. The code in Comment 1 compiles for g++ 6.1 to 9.3, then breaks since 10.1 (= all under -std=3Dc++17 -fconcepts). In conclusion, this makes sences but I didn't see that coming. Anyway, I th= ink a possible improvement is make ICE to an error of "ambigous full specialization". Or even better, a change in C++23 standard.=