public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58408] [C++11] __thread + trivially_constructible -> error
       [not found] <bug-58408-4@http.gcc.gnu.org/bugzilla/>
@ 2013-09-13 11:12 ` redi at gcc dot gnu.org
  2014-10-31  0:21 ` richard-gccbugzilla at metafoo dot co.uk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2013-09-13 11:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58408

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If you make it constexpr, which requires you to initialize the member, then it
works:

class Test {
 public:
 constexpr Test() = default;
 Test(char *b) { }
 int i = 0;
};


Clang accepts both that and your original.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/58408] [C++11] __thread + trivially_constructible -> error
       [not found] <bug-58408-4@http.gcc.gnu.org/bugzilla/>
  2013-09-13 11:12 ` [Bug c++/58408] [C++11] __thread + trivially_constructible -> error redi at gcc dot gnu.org
@ 2014-10-31  0:21 ` richard-gccbugzilla at metafoo dot co.uk
  2021-09-27 11:20 ` pinskia at gcc dot gnu.org
  2021-09-27 11:26 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-10-31  0:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58408

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #3 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
Workaround:

  __thread Test test = Test();


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/58408] [C++11] __thread + trivially_constructible -> error
       [not found] <bug-58408-4@http.gcc.gnu.org/bugzilla/>
  2013-09-13 11:12 ` [Bug c++/58408] [C++11] __thread + trivially_constructible -> error redi at gcc dot gnu.org
  2014-10-31  0:21 ` richard-gccbugzilla at metafoo dot co.uk
@ 2021-09-27 11:20 ` pinskia at gcc dot gnu.org
  2021-09-27 11:26 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-27 11:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58408

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Smith from comment #3)
> Workaround:
> 
>   __thread Test test = Test();

Or:
__thread Test test{};

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/58408] [C++11] __thread + trivially_constructible -> error
       [not found] <bug-58408-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-09-27 11:20 ` pinskia at gcc dot gnu.org
@ 2021-09-27 11:26 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-27 11:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58408

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note GCC does a decent job with:
class Test {
 public:
  Test() = default;
 Test(char *b) { }
 int i;
};
thread_local Test test;
----- CUT ----
GCC 7+ does not emit the "TLS wrapper function for test" at all.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-27 11:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-58408-4@http.gcc.gnu.org/bugzilla/>
2013-09-13 11:12 ` [Bug c++/58408] [C++11] __thread + trivially_constructible -> error redi at gcc dot gnu.org
2014-10-31  0:21 ` richard-gccbugzilla at metafoo dot co.uk
2021-09-27 11:20 ` pinskia at gcc dot gnu.org
2021-09-27 11:26 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).