public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101087] New: Unevaluated operand of sizeof affects noexcept operator
@ 2021-06-15 19:58 rkhlebnikov at bloomberg dot net
  2021-06-16  9:13 ` [Bug c++/101087] [9/10/11/12 Regression] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rkhlebnikov at bloomberg dot net @ 2021-06-15 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101087
           Summary: Unevaluated operand of sizeof affects noexcept
                    operator
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rkhlebnikov at bloomberg dot net
  Target Milestone: ---

clang, icc, MSVC all agree that the following `static_assert` should pass:

```
int f();
static_assert(noexcept(sizeof(f())), "");  // Fails on GCC
```

Such is not the case for gcc.

However, adding `decltype` to the mix helps:

```
int f();
static_assert(noexcept(sizeof(decltype(f()))), "");  // OK
```

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

end of thread, other threads:[~2021-07-08 22:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 19:58 [Bug c++/101087] New: Unevaluated operand of sizeof affects noexcept operator rkhlebnikov at bloomberg dot net
2021-06-16  9:13 ` [Bug c++/101087] [9/10/11/12 Regression] " redi at gcc dot gnu.org
2021-07-08  0:21 ` mpolacek at gcc dot gnu.org
2021-07-08 21:39 ` cvs-commit at gcc dot gnu.org
2021-07-08 21:48 ` cvs-commit at gcc dot gnu.org
2021-07-08 22:04 ` cvs-commit at gcc dot gnu.org
2021-07-08 22:06 ` [Bug c++/101087] [9 " mpolacek 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).