https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104066
Bug ID: 104066 Summary: "extern constinit long (* const syscall_reexported) (long, ...);" doesn't compile: gcc thinks "constinit" applies to return value, not to function pointer itself Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: safinaskar at mail dot ru Target Milestone: --- Consider this code: extern constinit long (* const syscall_reexported) (long, ...); (Godbolt: https://godbolt.org/z/de7W55rTo ) clang 13 happily compiles this code. gcc 11.2 rejects this code with message: <source>:1:8: error: 'constinit' on function return type is not allowed 1 | extern constinit long (* const syscall_reexported) (long, ...); | ^~~~~~~~~ I. e. gcc thinks that "constinit" applies to return value, not to function pointer itself