https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118433
Bug ID: 118433
Summary: Local scope deletion of a function is wrongly accepted
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
This program is accepted in GCC:
int main() {
void bar() = delete;
}
with the warning
> warning: declaration of 'void bar()' has 'extern' and is initialized
but it shall be an error, since '= delete' is a function definition and must
occur in a standalone declaration.
Online demo: https://gcc.godbolt.org/z/46dMz8n8K