Bug 278482 - KDevelop treats signed and unsigned chars as ints when used as template parameters
Summary: KDevelop treats signed and unsigned chars as ints when used as template param...
Status: RESOLVED FIXED
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: 2011-07-25 16:43 UTC by Alexander Shaduri
Modified: 2016-12-13 08:02 UTC (History)
1 user (show)

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


Attachments
unsigned char when used as template (214.83 KB, image/png)
2016-05-01 19:36 UTC, chaitanya srinivas ponnapalli
Details
Signed char used as template (212.95 KB, image/png)
2016-05-01 19:36 UTC, chaitanya srinivas ponnapalli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Shaduri 2011-07-25 16:43:25 UTC
Version:           git master (using KDE 4.6.3) 
OS:                Linux

I'm using KDevelop git master from 2011-07-25.
The following example demonstrates the problem:

template<typename T>
struct S { };

void func()
{
	S<signed char> s1;  // incorrectly treats as signed int
	S<unsigned char> s2;  // incorrectly treats as unsigned int
	signed char c1;  // correctly treats as signed char
}

Thanks!

Reproducible: Always

Steps to Reproduce:
Paste the above example into some .cpp file, move the mouse over s1 and s2.


Expected Results:  
char should be treated as char, not int.

openSUSE 11.3 x86_64
Comment 1 chaitanya srinivas ponnapalli 2016-05-01 19:36:00 UTC
Created attachment 98737 [details]
unsigned char when used as template

Reproduced the above steps:
	1. Executed the code given.
	2. Kdevelop does not treat the signed char type as signed int.
	3. Similarly, unsigned char is not treated as unsigned int.
	4. Attached the screen shots containing the code executed.
	
In accordance to the statement in expected result:

A char is both a character representation, but for the purposes of converting to an int, it's also a int representation. A simple char is used to store simple characters. However, if you are using character types as numbers then use signed char(-127 t0 +127 range) and unsigned char(0 t0 255.)
Comment 2 chaitanya srinivas ponnapalli 2016-05-01 19:36:36 UTC
Created attachment 98738 [details]
Signed char used as template
Comment 3 Kevin Funk 2016-05-01 20:19:14 UTC
Fixed in KDevelop 5, indeed.