Bug 311087 - KDevelop incorrectly parses single-argument function call followed by comma operator as a function declaration
Summary: KDevelop incorrectly parses single-argument function call followed by comma o...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: 4.4.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL: http://i.imgur.com/M7yFa.png
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-03 15:32 UTC by Daniel Scharrer
Modified: 2016-03-24 13:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented 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 Daniel Scharrer 2012-12-03 15:32:07 UTC
In the following code, KDevelop parses the line 'function(arg), arg = 0;' as two separate function declarations instead of a function call followed by a comma operator. Consequently the line doesn't show up when searching for uses of the 'arg' variable.


void function(int) { }

int main() {
	
	int arg = 1;
	
	function(arg), arg = 0;
	
	return arg;
}

Reproducible: Always

Steps to Reproduce:
1. Open the above code in KDevelop
Actual Results:  
KDevelop parses three different arg names: one variable and two function declarations of type void (int); http://i.imgur.com/M7yFa.png

Expected Results:  
There is only one arg.

This looks somehwat similar to the most vexing parse, but here the c++ standard agrees with the expected interpretation.
Comment 1 Aleix Pol 2013-03-31 00:53:14 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively
Comment 2 Kevin Funk 2016-03-24 13:41:04 UTC
Works in KDevelop 5, using the Clang backend.