public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102284] New: Can access object outside of its lifetime during constant evaluation
@ 2021-09-10 20:57 johelegp at gmail dot com
  2021-09-10 21:23 ` [Bug c++/102284] " johelegp at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: johelegp at gmail dot com @ 2021-09-10 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102284
           Summary: Can access object outside of its lifetime during
                    constant evaluation
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
                CC: johelegp at gmail dot com
  Target Milestone: ---

This is prohibited at https://eel.is/c++draft/basic.life#7.1.
See https://godbolt.org/z/exKnnT935.
```C++
#include <memory>
struct X { int x; };
int main() {
  []() consteval {
    {
      X x{};
      x.~X();
      ++x.x;
      std::construct_at(&x);
    }
    {
      union { X x{}; };
      x.~X();
      ++x.x;
    }
  }();
}
```

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

end of thread, other threads:[~2022-09-27  1:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 20:57 [Bug c++/102284] New: Can access object outside of its lifetime during constant evaluation johelegp at gmail dot com
2021-09-10 21:23 ` [Bug c++/102284] " johelegp at gmail dot com
2021-09-10 21:24 ` johelegp at gmail dot com
2021-09-10 21:26 ` pinskia at gcc dot gnu.org
2021-09-11  1:04 ` johelegp at gmail dot com
2022-01-17 11:12 ` pinskia at gcc dot gnu.org
2022-09-24 20:11 ` johelegp at gmail dot com
2022-09-27  1:40 ` johelegp at gmail dot com

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).