Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367472 - NullPointerException in 'Open Declaration'
Summary: NullPointerException in 'Open Declaration'
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-23 01:46 EST by Nathan Ridge CLA
Modified: 2012-02-23 11:33 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.