Bug 211652 - Cpp marks uses for first match, not best match according to types, if the argument is a character
Summary: Cpp marks uses for first match, not best match according to types, if the arg...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Unspecified
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-24 16:03 UTC by Milian Wolff
Modified: 2012-12-22 23:25 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milian Wolff 2009-10-24 16:03:55 UTC
Version:            (using KDE 4.3.2)
Installed from:    Archlinux Packages

The cpp language plugin does not mark uses correctly under certain conditions. I don't know the exact name for it, but the problem is the following:

void foo(int i);
void foo(char c);

foo('a');

=> marked as use of foo(int i), instead of foo(char c). Afaik, a real compiler uses the function with the "best matching" signature, i.e. with the least type conversions.

I have this problem often with QString's methods like remove, replace etc.
Comment 1 Milian Wolff 2009-10-24 16:05:27 UTC
Here's a better testcase:

void foo(int i){}
void foo(char c){}

int main() {
  foo('a');
}