From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A6DC73858C66; Tue, 26 Sep 2023 19:33:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6DC73858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695756803; bh=ozyfaTR0AzOGG/fy0NgQDRNkckVLkVEI0LC75IqLGYI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nnO8MrrJPL8f7i+gFEgn0tdzVV7TiZU76NYEn+KuGk1la3mdqKbj+ECoFtUpdd7RZ q05FqRbV/cWAaPge1pnWPtilwsobPwvsQe0UQ3H4F3eFv5BCWmlrLGWxBuk5s3dV8M Fl2mSWG/8WSv0Hd+r+tyQHF1RO1DwKDdZQZyrc20= From: "ed at catmur dot uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111602] [11/12/13/14 Regression] "Error: symbol is already defined" for variable template dependent on default argument lambda of class dependent on local type used in sfinae and non-sfinae contexts Date: Tue, 26 Sep 2023 19:33:23 +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: 14.0 X-Bugzilla-Keywords: assemble-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: ed at catmur dot uk 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: 11.5 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=3D111602 --- Comment #2 from Ed Catmur --- (In reply to Andrew Pinski from comment #1) > The local type of f() is not needed. Thanks! I was confused since the local type is required in this similar example: template struct P { static constexpr bool value =3D true; }; template constexpr bool P::value; template struct E {}; struct F { template::value>> F(T) {} }; template struct C { C(F =3D []{}) {} }; auto f() { struct T {} t; return t; } template decltype(T()) g() { return T(); } int main() { g>(); }=