Summary: | Do not show deleted methods in code completion | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Rolf Eike Beer <kde> |
Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aleixpol |
Priority: | NOR | ||
Version: | 4.3.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdevelop/17162ec728f33244eee7947a723763625633c2fe | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
Patch with fix and testcase
Suppress deleted constructors when trying to create an object |
Description
Rolf Eike Beer
2012-09-13 21:20:02 UTC
That's not correct. You can use private constructors to create class's instances within the class. Ehm, no. If it's deleted it is not there. It's not about foo::foo(), but about bar::bar(): class foo { foo(); } class bar { bar() = delete; } bar::bar() can't ever exist, any try of using it would result in a linker error. It's C++ things, so put it under C++ Created attachment 82756 [details]
Patch with fix and testcase
Git commit 17162ec728f33244eee7947a723763625633c2fe by Milian Wolff, on behalf of Rolf Eike Beer. Committed on 09/10/2013 at 16:39. Pushed by mwolff into branch '4.5'. do not offer explicitely deleted methods for code completion Again basically done by Milian. M +4 -0 languages/cpp/codecompletion/context.cpp M +8 -1 languages/cpp/tests/test_cppcodecompletion.cpp http://commits.kde.org/kdevelop/17162ec728f33244eee7947a723763625633c2fe Seems to be only half of the story. When trying to call a constructor e.g. like below the deleted methods still show up: A *a = new A( Created attachment 82779 [details]
Suppress deleted constructors when trying to create an object
Git commit dfae4bbc1f4a83f71e69dd162573f9b51c8b2c49 by Rolf Eike Beer. Committed on 10/10/2013 at 21:42. Pushed by dakon into branch '4.5'. when calling a constructor don't offer deleted ones for completion M +4 -1 languages/cpp/cppduchain/overloadresolution.cpp M +66 -0 languages/cpp/tests/test_cppcodecompletion.cpp M +2 -0 languages/cpp/tests/test_cppcodecompletion.h http://commits.kde.org/kdevelop/dfae4bbc1f4a83f71e69dd162573f9b51c8b2c49 |