thread_local can still be very broken for non-trivial types, 14 years
since C++11 was ratified, but it works plenty well for trivial types. So
suggest users use that (with a macro to opt-out).
[ChangeLog][QtCore][QThreadStorage] QThreadStorage will print a warning
suggesting the use of thread_local for use with primitive types that are
not pointers. In fact, switching to the C++11 functionality is advisable
for all types, but some runtimes have bugs concerning destruction order.
This warning can be suppressed by #define'ing the macro
Q_NO_THREAD_STORAGE_TRIVIAL_WARNING.
This code is actually very old (looks like it has pre-C++98
compatibility support for MSVC 6.0) and could use a refactor, but it's
not worth my time to do it or review it for such old content. Stop using
QThreadStorage if you can.
Task-number: QTBUG-117850
Change-Id: I906ba7872388fc578c78fffd92231118decfd67e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>