From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A460385ED4B; Sun, 30 Aug 2020 17:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A460385ED4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598808297; bh=GN2kPM5oK7w6pnTFRv1JyY8bTXjgfhMTHDkWawxHWqg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G8jC1XYL+zXL6ZZAUv/l4nRut+xspHTcDNTBMsLc97lHR9xicfX12LBYZVRq5mn98 usbxD0Z3RmX410WuUPOx/Bw/Votahi53zTBnNbReuuV29hIbX8wOZVk2oFeIGLlEET pLe80EZkUvqJex5Y0MIiWY3wDjZeXJVU6gM2S4IQ= From: "tobias.bruell at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/81880] thread_local static member template initialisation fails Date: Sun, 30 Aug 2020 17:24:56 +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: 8.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tobias.bruell 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: cc 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: Sun, 30 Aug 2020 17:24:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81880 Toby Brull changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tobias.bruell at gmail dot= com --- Comment #3 from Toby Brull --- I played around a bit with gcc, and it looks like the example can be made to work via the following diff: --------------------------------------- diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 639b00264d8..f6b10174f1b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3898,6 +3898,8 @@ finish_id_expression_1 (tree id_expression, decl =3D finish_template_variable (decl); mark_used (decl); decl =3D convert_from_reference (decl); + if (tree wrap =3D maybe_get_tls_wrapper_call (decl)) + decl =3D wrap; } else if (concept_check_p (decl)) { --------------------------------------- Not sure if this makes sense, though, in the greater scheme of things. So I= 'll just leave that here FYI.=