From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 62FC73858D38; Fri, 12 Apr 2024 09:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62FC73858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712913897; bh=SrTVluxsFe6SWHbus5ZeXrvjuktjBGWjSBIAPMcaiOs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wka7HfZD0cwnVd9s6Pg8I6H05MAbrkMthEqZQ5+n5JOdzuQsDHQNSA7H2xlRLSs29 2MW+a1OICUtIi0MGEJLoUuTcrojGJUs6euuMXedgN/LbcowNvADCj7Mefdiaom2zLA fjk03QUGI1a0FQ3rF9rBGRGiaHS46+d8D5NE4B44= From: "vin.piquet at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114695] Template argument deduction and defaulted template template parameters Date: Fri, 12 Apr 2024 09:24:55 +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: 13.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: vin.piquet at gmail dot com 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114695 --- Comment #3 from Vincent Piquet --- Interesting. Now I think the issue may actually be caused by pack expansion= on the call site. The issue also happens when Foo only has one base class, alb= eit with a different error that at least has concise types on both sides. =3D=3D=3D=3D test.cpp =3D=3D=3D=3D template struct Bar { void accept(X value) { } }; template struct Foo; template struct Foo...> : Bar... { template typename B =3D Bar> constexpr static B* slice_by_type(B* self) { return self; } template void accept(Us... values) { (slice_by_type(this)->accept(values), ...); } }; int main() { Foo> foo; foo.accept(3.14f); } =3D=3D=3D=3D test.cpp =3D=3D=3D=3D =3D=3D=3D=3D GCC 13.2 =3D=3D=3D=3D test.cpp: In instantiation of 'void Foo...>::accept(Us ...) [with U= s =3D {float}; Ts =3D {float}]': test.cpp:22:15: required from here test.cpp:16:27: error: no matching function for call to 'Foo >::slice_by_type(Foo >*)' 16 | (slice_by_type(this)->accept(values), ...); | ~~~~~~~~~~~~~~~~~^~~~~~ test.cpp:10:28: note: candidate: 'template class B> static constexpr B* Foo...>::slice_by_type(B*) [with B =3D T;= Ts =3D {float}]' 10 | constexpr static B* slice_by_type(B* self) { | ^~~~~~~~~~~~~ test.cpp:10:28: note: template argument deduction/substitution failed: test.cpp:16:27: note: deduced conflicting types for parameter 'T' ('float' and 'Bar') 16 | (slice_by_type(this)->accept(values), ...); | ~~~~~~~~~~~~~~~~~^~~~~~ =3D=3D=3D=3D GCC 13.2 =3D=3D=3D=3D This may however be simplified so much that it becomes another bug. I'm uns= ure.=