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

            Bug ID: 93769
           Summary: Slightly wrong error message for static_asserts with
                    no message
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gennaro.prota+gccbugzilla at gmail dot com
  Target Milestone: ---

Compiling with -std=c++14 --pedantic, the following translation unit:

  static_assert(true);

  int
  main()
  {
  }

yields:

<source>:1:15: warning: static_assert without a message only available with
'-std=c++17' or '-std=gnu++17' [-Wpedantic]

This is not true, because the compiler accepts it even with -std=c++11 or
-std=c++14.

Assuming this is intentional (but, if not, the message would still need
tweaking: e.g. it will be accepted with std=c++20, as well), I suggest to
reword the error message to:

  static_assert without a message is non-standard before C++17

Reply via email to