https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111173
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:c121afc3b6c96a1f229ba0c4a4de6bd4b6be9a53

commit r14-3576-gc121afc3b6c96a1f229ba0c4a4de6bd4b6be9a53
Author: Marek Polacek <pola...@redhat.com>
Date:   Tue Aug 29 13:16:41 2023 -0400

    c++: disallow constinit on functions [PR111173]

    [dcl.constinit]/1: The constinit specifier shall be applied only to a
declaration
    of a variable with static or thread storage duration.

    and while we detect

      constinit int fn();

    we weren't detecting

      using F = int();
      constinit F f;

            PR c++/111173

    gcc/cp/ChangeLog:

            * decl.cc (grokdeclarator): Disallow constinit on functions.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/constinit19.C: New test.

Reply via email to