Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371092 - Autocompletion and static members
Summary: Autocompletion and static members
Status: RESOLVED INVALID
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 10:15 EST by Harry Houdini CLA
Modified: 2017-01-11 21:30 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harry Houdini CLA 2012-02-09 10:15:55 EST
Build Identifier: 20111215-0110

Hello,

When I try to access static members of a class (MyClass::...), the autocompletion shows me many function from the standard library, whereas they are not in my class scope.

Why doesn't it show me only my class members ?


struct myClass
{
	int foo = 0;
	static int bar;
};

int main()
{
	// Uncomment the code below, go to the end of the line,
	// and press Ctrl+Enter :
	// many standard functions are displayed in the list.

	// myClass::

	return 0;
}


Reproducible: Always

Steps to Reproduce:
Try the code in the details.
Comment 1 Harry Houdini CLA 2012-02-10 08:42:18 EST
It seems the problem doesn't occur in Indigo.
Comment 2 Axel Mueller CLA 2012-02-10 09:18:17 EST
Markus, I hope you do not mind that I added you to this bug report. The bug reporter initially put this bug to the codan component by accident. Unfortunately, the Assigned To: field does not change when you change the component.

BTW, this bug report is the result of a discussion on the CDT forum http://www.eclipse.org/forums/index.php/m/795473/#msg_795473

The bug seems to occur only in the Juno build.
Comment 3 Markus Schorn CLA 2012-04-04 09:07:54 EDT
I cannot reproduce the issue with the latest version for Juno. 
You may be right that the feature was broken in an earlier build.
Comment 4 Damian Kwiatkowski CLA 2012-08-08 05:12:42 EDT
I have still the sam problem. I have the newest version of Eclipse Juno "Eclipse IDE for C/C++ Developers" and plugin "CDT Build System Core" and "C/C++ Managed Builder UI" in version 8.1.201206111645. I use the same workspace as I use in earlier versions of Eclipse. My platform is Windows 7.

When I use content assist after "NameOfMyStaticClass::" then I have in proposals C functions from math.h, stdlib.h etc. There are even C functions not found in my libraries. It seems such as templates. I have the same proposals but without fields of my NameOfMyStaticClass if I use only "::" in code without name of class.
I observed than the same proposals are if I simply activate content assist (Ctrl+space) in blank line.

"NameOfMyStaticClass::" should show only fields and functions from "NameOfMyStaticClass" without global proposals.
Comment 5 Asad Saeed CLA 2012-10-04 13:55:40 EDT
I am also able to reproduce this bug. when using content assist for static members of a class using :: operator I will get a list of functions/macro's from the standard library, if they have associated documentation. It does not seem to be invalid or resolved.

This is on rhel 6.2 with CDT Version: 8.1.1.201209170703
Comment 6 Asad Saeed CLA 2012-10-04 14:25:23 EDT
This is actually a bug when 
C/C++ Library API Documentation Hover Help	1.0.0.201209191645	
org.eclipse.linuxtools.cdt.libhover.feature.feature.group	Eclipse Linux Tools

is installed. Removing this plugin fixes this issue.
Comment 7 hooluupog CLA 2015-02-16 21:54:27 EST
Agree with Asad Saeed.This bug can be reproduced on Kepler. Libhover plugin is the culprit.
Comment 8 Nathan Ridge CLA 2017-01-11 21:30:09 EST
Note that the underlying libhover bug seems to have been fixed since.