https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82295
Bug ID: 82295 Summary: Two errors produced with private/protected deleted methods Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: denis.campredon at gmail dot com Target Milestone: --- Hello, The following code produces ------------------- class C { int f() = delete; }; int f() { return C().f(); } ------------------ Will produce the followings messages ----------- <source>: In function 'int f()': <source>:6:15: error: 'int C::f()' is private within this context return C().f(); ^ <source>:2:6: note: declared private here int f() = delete; ^ <source>:6:15: error: use of deleted function 'int C::f()' return C().f(); ^ <source>:2:6: note: declared here int f() = delete; ^ ----------------- Since the method is deleted only the second error should be displayed.