Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339977 - Indexer resolves template-id imprecisely
Summary: Indexer resolves template-id imprecisely
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 02:43 EDT by Lukas Felber CLA
Modified: 2011-03-28 11:42 EDT (History)
1 user (show)

See Also:


Attachments
testcase + fix (5.26 KB, patch)
2011-03-28 05:37 EDT, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Felber CLA 2011-03-15 02:43:33 EDT
Build Identifier: M20100909-0800

The indexer seems to have problems while resolving template-ids of type X<void()> if the template definition look like this:

template<typename T> class X;
template<typename T> class X<T (void)> { };

the template-id resolves to the first X instead of to the second one.

When changing the template-id to resolve to X<void(void)> or the second definition to "template<typename T> class X<T ()> { };" ("void" removed), the indexer is able to resolve the template-id correctly.
I think that, according to the C++ standard 8.3.5, void(void) and void() should be treated equivalently. is that correct?

Reproducible: Always

Steps to Reproduce:
1. open source file containing:
template<typename T> class X;
template<typename T> class X<T (void)> { };
int main() {
	X<void()> f;
}
2. ctrl+click on the template-id X<void()>. This sets the selection to X on code line 1 instead of X on code line 2.
Comment 1 Markus Schorn CLA 2011-03-28 05:37:36 EDT
Created attachment 191985 [details]
testcase + fix
Comment 2 Markus Schorn CLA 2011-03-28 05:38:50 EDT
Fixed in 8.0.