Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367472

Summary: NullPointerException in 'Open Declaration'
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.1.0   
Target Milestone: 8.1.0   
Hardware: All   
OS: All   
Whiteboard:

Description Nathan Ridge CLA 2011-12-23 01:46:44 EST
In the following code:

template<typename _Tp>
class vector
{
};

template<typename T>
struct bar {
	void foo() {
		vector<T> index;
		for (const auto& entry : index)
		{
		}
	}
};

when I right click on 'entry' and click 'Open Declaration', I get a popup with the following error:

An internal error occurred during: "Open Declaration".
java.lang.NullPointerException

Moreover, syntax coloring for the whole file is disabled. If I comment out the line containing the for loop, the syntax coloring kicks back in.

This was tested with Eclipse Juno M4. The problem does not occur with Indigo.
Comment 1 Nathan Ridge CLA 2011-12-23 01:51:34 EST
More precisely, *semantic* coloring is disabled in the whole file unless I comment out the for loop.
Comment 2 Markus Schorn CLA 2011-12-23 06:04:53 EST
Problem has gone away with the latest fix for bug 332883. Added testcase and fixed CPPUnknownScope to return an empty array rather than null.