https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92073
Bug ID: 92073
Summary: references/pointers to thread_local are not constant
expressions
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tyker at outlook dot com
Target Milestone: ---
currently gcc accepts the folowing:
```
template<int &data>
struct A {};
static thread_local int b;
A<b> a;
```
this is not valid.
http://eel.is/c++draft/expr.const#10.2
says if a constant expression is a pointer to an object it should be in static
storage.
also, compilers(icc, clang, msvc) reject this code https://godbolt.org/z/d47fb9