Bug 373063

Summary: Tooltip for variables declared "auto" doesn't show actual type
Product: [Applications] kdevelop Reporter: Nicolás Alvarez <nalvarez>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
URL: https://llvm.org/bugs/show_bug.cgi?id=18669
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nicolás Alvarez 2016-11-29 05:30:16 UTC
If I have code like this:

long x=42;
auto y=x;

The tooltip for 'y' says 'auto y'. I would expect it to say 'long y', or maybe show somewhere else in the tooltip what the deduced type is.
Comment 1 Kevin Funk 2016-11-29 07:38:15 UTC
You're probably running a too old Clang/LLVM version.

Upstream bug has been resolved a while ago: https://llvm.org/bugs/show_bug.cgi?id=18669

Patch should be part of some 3.8 release, and definitely is in 3.9.0+.

'y' is deduced to 'int' here.
Comment 2 Nicolás Alvarez 2016-11-30 02:21:51 UTC
I confirm this is fixed when using clang 3.8.1.

Well, kind of fixed. It seems bug 369840 affects auto too:

unsigned long int x;
auto y = x;

The tooltip for y says 'int', dropping the 'unsigned' and 'long' modifiers.