Bug 273658 - Confusion with nested namespace
Summary: Confusion with nested namespace
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.2.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-19 17:44 UTC by Olivier Goffart
Modified: 2016-09-08 20:17 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Goffart 2011-05-19 17:44:26 UTC
Version:           4.2.1 (using KDE 4.6.3) 
OS:                Linux

See this example,   
Kdevelop thinks 'Isolate a' in the function is from the wrong namespace

//----
namespace v8 {
struct Isolate { int bar(); };

namespace internal {
struct Isolate { int foo(); };

void function() {
    Isolate a;   // this should be v8::internal::Isolate, but kdevelop thinks it is v8::Isolate
    a.foo();
}
}
}
//-----

Reproducible: Always

Steps to Reproduce:
Copy paste the code above in KDevelop
Comment 1 Milian Wolff 2011-05-29 00:03:17 UTC
confirmed
Comment 2 Milian Wolff 2011-06-01 22:06:16 UTC
Git commit 04cfa432924a102f1f2d7f218667fc5c07b3dbf5 by Milian Wolff.
Committed on 01/06/2011 at 21:58.
Pushed by mwolff into branch 'master'.

fix type association in nested namespace and multiple matches for an unqualified identifier

we now prefer more qualified matches (i.e. more parts in the qualified identifier).
this should hopefully be an easy implementation of the spec (see section 3.4.1)

TODO: use of type specifier in a declaration are still incorrectly assigned,
fix pending - probably inside TypeASTVisitor::visitSimpleTypeSpecifier

CCBUG: 273658

M  +7    -1    languages/cpp/cppduchain/tests/test_duchain.cpp     
M  +22   -15   languages/cpp/cppduchain/typebuilder.cpp     

http://commits.kde.org/kdevelop/04cfa432924a102f1f2d7f218667fc5c07b3dbf5
Comment 3 Milian Wolff 2011-06-01 22:06:16 UTC
Git commit ee8470d2c6256b55decbc11376fb947c539e1cfd by Milian Wolff.
Committed on 01/06/2011 at 20:08.
Pushed by mwolff into branch 'master'.

add testcase for wrong type association in case of nested namespaces

CCBUG: 273658

M  +45   -0    languages/cpp/cppduchain/tests/test_duchain.cpp     
M  +1    -0    languages/cpp/cppduchain/tests/test_duchain.h     

http://commits.kde.org/kdevelop/ee8470d2c6256b55decbc11376fb947c539e1cfd
Comment 4 Kevin Funk 2016-09-08 20:17:32 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.