public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102191] New: Can't return prvalue with potentially-throwing destructor during constant evaluation
@ 2021-09-03 14:57 johelegp at gmail dot com
  2022-01-06  2:08 ` [Bug c++/102191] [C++20] " jason at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: johelegp at gmail dot com @ 2021-09-03 14:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102191
           Summary: Can't return prvalue with potentially-throwing
                    destructor during constant evaluation
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          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: ---

See https://godbolt.org/z/8evPWv7cb.
```C++
struct X {
  struct A {
    constexpr ~A() noexcept(false) { }
  };

  constexpr A operator()(auto...) { return {}; }
};

void f() { []() consteval { X{}(); }(); }
```
```
<source>: In function 'void f()':
<source>:9:37:   in 'constexpr' expansion of '<lambda closure
object>f()::<lambda()>().f()::<lambda()>()'
<source>:9:37:   in 'constexpr' expansion of 'X::operator()(auto:1 ...) [with
auto:1 = {}]()'
<source>:9:37: error: modification of '<anonymous>' is not a constant
expression
    9 | void f() { []() consteval { X{}(); }(); }
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~^~
Compiler returned: 1
```

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

end of thread, other threads:[~2023-11-17  0:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03 14:57 [Bug c++/102191] New: Can't return prvalue with potentially-throwing destructor during constant evaluation johelegp at gmail dot com
2022-01-06  2:08 ` [Bug c++/102191] [C++20] " jason at gcc dot gnu.org
2022-01-07  0:26 ` cvs-commit at gcc dot gnu.org
2022-02-01 22:51 ` jason at gcc dot gnu.org
2023-11-02 20:01 ` cvs-commit at gcc dot gnu.org
2023-11-17  0:21 ` cvs-commit at gcc dot gnu.org
2023-11-17  0:21 ` cvs-commit 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).