Bug 220284 - function of template class not correctly resolved when template parameter is set in a #define block
Summary: function of template class not correctly resolved when template parameter is ...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-27 16:48 UTC by Thorben Kröger
Modified: 2016-01-24 12:44 UTC (History)
1 user (show)

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


Attachments
small testcase (609 bytes, text/x-c++src)
2009-12-27 16:49 UTC, Thorben Kröger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thorben Kröger 2009-12-27 16:48:39 UTC
Version:           svn from 24.12.2009 (using Devel)
Installed from:    Compiled sources

Here is a small example program, see the comments about what goes wrong. I also attach this for convenience:

#ifdef NDEBUG
    const bool NO_DEBUG = true; 
#else
    const bool NO_DEBUG = false;
#endif

template<bool B> class Test;
template<> class Test<false> {
public:
    void test() {}
};
template<> class Test<true> {
public:
    void test() {}
};

int main() {
    NO_DEBUG; // <-- kdevelop knows that this evaluates to false here
    
    Test<NO_DEBUG> test1; // <--- even here, kdevelop shows me "false" on hover
    test1.test(); // <-- does NOT work, semantic analysis claims "declaration not found"
    
    Test<true> test2;
    test2.test(); // <-- now, this DOES work, no problem for kdevelop here...
}
Comment 1 Thorben Kröger 2009-12-27 16:49:09 UTC
Created attachment 39389 [details]
small testcase
Comment 2 Milian Wolff 2010-01-05 01:48:50 UTC
confirmed
Comment 3 Andrey Cygankov 2016-01-23 22:32:04 UTC
I tried to reproduce the bug in KDevelop 5, and everything displayed without semantic error Probably it is necessary to close.
Comment 4 Milian Wolff 2016-01-24 12:44:17 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.

Sorry for the inconvenience, I hope you understand the reasoning above.

Cheers