public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/99059] New: Static inline variable can't refer to itself @ 2021-02-10 14:17 vincent.hamp at higaski dot at 2021-02-10 22:21 ` [Bug c++/99059] " redi at gcc dot gnu.org ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: vincent.hamp at higaski dot at @ 2021-02-10 14:17 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99059 Bug ID: 99059 Summary: Static inline variable can't refer to itself Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vincent.hamp at higaski dot at Target Milestone: --- Declaring a static inline member variable and initializing it with a pointer to itself is currently impossible. The textbook example for such code would probably be a linked list of some sort: struct link { link* next{nullptr}; link* prev{nullptr}; }; struct list { static inline link tail{&tail, &tail}; }; list l; Making the member just static and initializing it outside of the class works, but this kinda breaks my mental model of "static inline" as just being syntactic sugar. Is this an actual bug or just some overlooked thing in the standard? ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/99059] Static inline variable can't refer to itself 2021-02-10 14:17 [Bug c++/99059] New: Static inline variable can't refer to itself vincent.hamp at higaski dot at @ 2021-02-10 22:21 ` redi at gcc dot gnu.org 2021-02-10 22:22 ` redi at gcc dot gnu.org ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: redi at gcc dot gnu.org @ 2021-02-10 22:21 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99059 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-02-10 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/99059] Static inline variable can't refer to itself 2021-02-10 14:17 [Bug c++/99059] New: Static inline variable can't refer to itself vincent.hamp at higaski dot at 2021-02-10 22:21 ` [Bug c++/99059] " redi at gcc dot gnu.org @ 2021-02-10 22:22 ` redi at gcc dot gnu.org 2021-02-21 0:39 ` ldalessandro at gmail dot com ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: redi at gcc dot gnu.org @ 2021-02-10 22:22 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99059 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Looks like a bug. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/99059] Static inline variable can't refer to itself 2021-02-10 14:17 [Bug c++/99059] New: Static inline variable can't refer to itself vincent.hamp at higaski dot at 2021-02-10 22:21 ` [Bug c++/99059] " redi at gcc dot gnu.org 2021-02-10 22:22 ` redi at gcc dot gnu.org @ 2021-02-21 0:39 ` ldalessandro at gmail dot com 2021-12-09 2:57 ` adrianh.bsc at gmail dot com 2021-12-09 3:06 ` pinskia at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: ldalessandro at gmail dot com @ 2021-02-21 0:39 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99059 --- Comment #2 from Luke Dalessandro <ldalessandro at gmail dot com> --- Ran into this in a static constexpr initializer, not really a workaround for it that I can find. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/99059] Static inline variable can't refer to itself 2021-02-10 14:17 [Bug c++/99059] New: Static inline variable can't refer to itself vincent.hamp at higaski dot at ` (2 preceding siblings ...) 2021-02-21 0:39 ` ldalessandro at gmail dot com @ 2021-12-09 2:57 ` adrianh.bsc at gmail dot com 2021-12-09 3:06 ` pinskia at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: adrianh.bsc at gmail dot com @ 2021-12-09 2:57 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99059 Jack Adrian Zappa <adrianh.bsc at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adrianh.bsc at gmail dot com --- Comment #3 from Jack Adrian Zappa <adrianh.bsc at gmail dot com> --- Ran into this yesterday and took me a day to figure out what was going on. Wokrs in clang. Pls fix. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/99059] Static inline variable can't refer to itself 2021-02-10 14:17 [Bug c++/99059] New: Static inline variable can't refer to itself vincent.hamp at higaski dot at ` (3 preceding siblings ...) 2021-12-09 2:57 ` adrianh.bsc at gmail dot com @ 2021-12-09 3:06 ` pinskia at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-12-09 3:06 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99059 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Dup of bug 64989 *** This bug has been marked as a duplicate of bug 64989 *** ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-12-09 3:06 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-02-10 14:17 [Bug c++/99059] New: Static inline variable can't refer to itself vincent.hamp at higaski dot at 2021-02-10 22:21 ` [Bug c++/99059] " redi at gcc dot gnu.org 2021-02-10 22:22 ` redi at gcc dot gnu.org 2021-02-21 0:39 ` ldalessandro at gmail dot com 2021-12-09 2:57 ` adrianh.bsc at gmail dot com 2021-12-09 3:06 ` 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).