public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97237] New: [10/11 Regression] static_assert does not accept fpermissive code
@ 2020-09-29  8:26 lutztonineubert at gmail dot com
  2020-09-29 10:11 ` [Bug c++/97237] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lutztonineubert at gmail dot com @ 2020-09-29  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97237
           Summary: [10/11 Regression] static_assert does not accept
                    fpermissive code
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lutztonineubert at gmail dot com
  Target Milestone: ---

The following valid code:

  constexpr bool test() {
      auto i = 1 << 132;
      return true;
  }

  static_assert(test());

Build with GCC -fpermissive does compile in GCC 9 but not in 10/11:

> non-constant condition for static assertion

See: https://gcc.godbolt.org/z/r85zvP

But this code is valid in all versions:

  constexpr bool test() {
      auto i = 1 << 132;
      return true;
  }

  constexpr auto t = test();

  static_assert(t);

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

end of thread, other threads:[~2020-11-05  7:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  8:26 [Bug c++/97237] New: [10/11 Regression] static_assert does not accept fpermissive code lutztonineubert at gmail dot com
2020-09-29 10:11 ` [Bug c++/97237] " redi at gcc dot gnu.org
2020-09-29 10:21 ` jakub at gcc dot gnu.org
2020-09-29 10:43 ` redi at gcc dot gnu.org
2020-10-16 12:19 ` rguenth at gcc dot gnu.org
2020-10-24 20:09 ` lutztonineubert at gmail dot com
2020-11-05  7:01 ` lutztonineubert 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).