https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104994
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:54bccc8e05f6f9480b50c4edfb2a364d344e72c0 commit r9-10141-g54bccc8e05f6f9480b50c4edfb2a364d344e72c0 Author: Jakub Jelinek <ja...@redhat.com> Date: Thu Mar 24 10:12:25 2022 +0100 c++: extern thread_local declarations in constexpr [PR104994] C++14 to C++20 apparently should allow extern thread_local declarations in constexpr functions, however useless they are there (because accessing such vars is not valid in a constant expression, perhaps sizeof/decltype). P2242 changed that for C++23 to passing through declaration but https://cplusplus.github.io/CWG/issues/2552.html has been filed for it yesterday. 2022-03-24 Jakub Jelinek <ja...@redhat.com> PR c++/104994 * constexpr.c (potential_constant_expression_1): Don't diagnose extern thread_local declarations. * decl.c (start_decl): Likewise. * g++.dg/cpp2a/constexpr-nonlit7.C: New test. (cherry picked from commit 72124f487ccb5c8065dd5f7b8fba254600b7e611)