https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81880
Toby Brull <tobias.bruell at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tobias.bruell at gmail dot com --- Comment #3 from Toby Brull <tobias.bruell at gmail dot com> --- 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 = finish_template_variable (decl); mark_used (decl); decl = convert_from_reference (decl); + if (tree wrap = maybe_get_tls_wrapper_call (decl)) + decl = 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.