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 <jakub@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)