Bug 243061 - KDevelop fails to complete a template class constant
Summary: KDevelop fails to complete a template class constant
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 18:55 UTC by Valentyn Pavliuchenko
Modified: 2016-05-01 08:54 UTC (History)
2 users (show)

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


Attachments
kdevelop correctly calculates the factorial for integers greater than 2 (199.31 KB, image/png)
2016-04-30 06:00 UTC, chaitanya srinivas ponnapalli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valentyn Pavliuchenko 2010-06-28 18:55:54 UTC
Version:           SVN (using KDE 4.4.4) 
OS:                Linux

In the following code I see "2" as a value of factorial for 2 and upper values. Actually for 2 it is the right answer, but for 3 and up it is wrong.

Code:

template <int V>
class fact : public fact<V-1>
{
public:
	static const int res = V * fact<V-1>::res;
};

template <>
class fact<1>
{
public:
	static const  int res = 1;
};

int main()
{
	fact<3> a;
	a.<invoke autocomplete here>
	return 0;
}



Reproducible: Always
Comment 1 chaitanya srinivas ponnapalli 2016-04-30 06:00:43 UTC
Created attachment 98692 [details]
kdevelop correctly calculates the factorial for integers greater than 2

Hi,

I reproduced the code provided and there is no issue with the way kdevelop calculates the value of the factorial for integers greater than 2.

Attached a screen shot of the code along with the output produced.

Thanks
Comment 2 Kevin Funk 2016-05-01 08:54:17 UTC
@Chaitanya: Note: the bug report is about the results of the code completion, not about the results of running above program.

Further debugging: Under KDevelop 5, we no longer appear to show the value of constant variables. Marking this as invalid, as it no longer applies to the KDevelop 5 C++ support.