Bug 280720

Summary: wrong datatype if a cast is used in Array declaration
Product: [Applications] kdevelop Reporter: Bernd Buschinski <b.buschinski>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: cponnapalli
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.0.0
Sentry Crash Report:
Attachments: patch adds tests for this bug, no fix
Data type displayed if a cast is used in array declaration

Description Bernd Buschinski 2011-08-24 16:07:36 UTC
Version:           git master (using KDE 4.7.0) 
OS:                Linux

Kdevelop shows wrong datatype if a cast is used in Array declaration.

Working Example:

bool Array[4];
Array[2] = false;

if I move my mouse over Array[2] I get
"bool[4] Array"
Sofar so good, the expected Result.


Reproducible: Always

Steps to Reproduce:
Broken datatype Example:

bool Array[(int)4];
Array[2] = false;

Actual Results:  
if I move my mouse over Array[2] I get
"int Array"
which is wrong, as Array is still an array of bools, not a single int

Expected Results:  
"bool[4] Array"
or even "bool[(int)4] Array"
which looks a bit weird, but is not wrong
Comment 1 Bernd Buschinski 2011-10-29 14:29:47 UTC
Created attachment 65013 [details]
patch adds tests for this bug, no fix

test runs fine for simple case
"bool Array[3];"
but fails with
"bool Array[(int)3];"
Comment 2 chaitanya srinivas ponnapalli 2016-05-09 06:41:42 UTC
Created attachment 98851 [details]
Data type displayed if a cast is used in array declaration

Reproduced the steps as described in the issue:
1. Created array of bool as shown:
bool Array[(int)4];
2. The resultant datatype after pointing the mouse at it, is shown correctly as array of bool and not as "int Array".
3. The issue is fixed.
4. Attached screenshot for reference.
Comment 3 Kevin Funk 2016-05-09 08:20:57 UTC
Appears fixed under KDevelop 5