Bug 326041 - Invalid problem reported about "use of deleted function"
Summary: Invalid problem reported about "use of deleted function"
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-15 09:37 UTC by Job Noorman
Modified: 2017-02-25 14:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
MWE (115 bytes, text/x-c++src)
2013-10-15 09:38 UTC, Job Noorman
Details
MWE without LLVM (129 bytes, text/x-c++src)
2013-11-06 20:42 UTC, Thomas Posch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Job Noorman 2013-10-15 09:37:25 UTC
I noticed that the semantic analysis sometimes reports "use of deleted function" for functions that are not deleted. Unfortunately, I'm not able to produce a standalone example and only noticed this problem while using LLVM. I'll attach a MWE.

Reproducible: Always
Comment 1 Job Noorman 2013-10-15 09:38:45 UTC
Created attachment 82857 [details]
MWE

The problem is reported on the call to llvm::Module::getContext()
Comment 2 Thomas Posch 2013-11-06 20:42:39 UTC
Created attachment 83384 [details]
MWE without LLVM

When the move assignment ctor of a class is deleted, the semantic analysis wrongly complains about the use of a deleted function when taking a reference to an object of said class.

[not always reproducible:] If the '= delete' is changed to '= default' the error remains.

KDevelop 4.5.2; KDE 4.11.2
Comment 3 Hideaki Kimura 2014-04-29 20:34:17 UTC
I'm getting the same semantic analysis error.
My kdevelop version is 4.6.0.

Here's a minimal example to reproduce the issue:

class TestClass {
 public:
    TestClass() = delete;
    TestClass(const TestClass& other) = delete;
    TestClass(int aaa) : aaa_(aaa) {}
    int aaa_;
};
int main(int argc, char **argv) {
    TestClass test(123);
    TestClass& ref = test;
    return 0;
}

Seems like the semantic analysis module thinks that "TestClass& ref = test;" is invoking a copy constructor, which is not the case.
Comment 4 Hideaki Kimura 2015-05-14 16:58:26 UTC
Any progress on this?
This issue still happens in kdevelop 4.7.1
Comment 5 Milian Wolff 2015-05-18 16:09:47 UTC
Sorry to say, but so far there has been no progress on our old cpp plugin in that regard. Instead, we concentrate on our replacement cpp plugin based on clang, which won't have this issue (and many others).

bye
Comment 6 Hideaki Kimura 2015-05-18 16:27:47 UTC
(In reply to Milian Wolff from comment #5)
> Sorry to say, but so far there has been no progress on our old cpp plugin in
> that regard. Instead, we concentrate on our replacement cpp plugin based on
> clang, which won't have this issue (and many others).
> 
> bye

Oh, didn't know that such a refactoring is happening: http://kfunk.org/2014/04/28/gsoc-2014-improving-the-clang-integration-in-kdevelop/

Sounds like much more beneficial than individual bug fixes. Great work!
Looking forward to seeing its release.
Comment 7 Kevin Funk 2016-03-09 08:14:33 UTC
Hello!

We are working on a new clang-based C/C++ language plugin for KDevelop 5 which
supersedes the old C++ plugin in KDevelop 4. See e.g.:
https://www.kdevelop.org/news/first-beta-release-kdevelop-500-available

Due to a lack of manpower, we cannot fix bugs in the old C++ plugin. We rather
want to supply a good Clang based C++ experience for KDevelop 5 than wasting
our time on the legacy C++ support for KDevelop 4.

With the new clang-based C/C++ language plugin, the bug presented here does not
occur. In my testing. For these reasons, I'll close this bug. Please stay tuned
for KDevelop 5.

If you think this bug is applicable to Clang/KDevelop 5, please reopen the
report and add new information on how to reproduce the bug there.