http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49066
Summary: [C++0x] Non-defining declaration of deleted function suppresses usage validation Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: daniel.krueg...@googlemail.com CC: ja...@redhat.com gcc 4.7.0 20110514 (experimental) in C++0x mode compiles the following program successfully (but produces a link error): //-- void foo() = delete; void foo(); int main() { foo(); } //-- It seems that the second (non-defining) declaration of the deleted function foo() has the effect of "undeleting" the initial deleted definition. I cannot deduce this kind of semantics from the FDIS wording: The program should be rejected, when compiled [In a strict sense the compiler probably behaves conforming, because in the end the program *is* ill-formed, but to me it looks like a generally expected behaviour, that this should done by the compiler, not by the linker. I'm hesitating to categorize this as an enhancement request and therefore I did not so].