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

Bug 339977

Summary: Indexer resolves template-id imprecisely
Product: [Tools] CDT Reporter: Lukas Felber <l.felber>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
testcase + fix mschorn.eclipse: iplog-

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.