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

            Bug ID: 107710
           Summary: error: ‘constinit’ on function return type is not
                    allowed
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

constinit void (*p)() = nullptr;


With -std=c++20 this is rejected:

func.cc:1:1: error: ‘constinit’ on function return type is not allowed
    1 | constinit void (*p)() = nullptr;
      | ^~~~~~~~~


Clang and EDG accept it.

Reply via email to