Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355304 - Erroneous "unresolved symbol" in explicit template specialization
Summary: Erroneous "unresolved symbol" in explicit template specialization
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: 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-08-20 22:28 EDT by sangar 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 sangar CLA 2011-08-20 22:28:01 EDT
Build Identifier: 20110615-0604

The parser seems to fail inferring the type of an explicitly specialized template of a function, when the type is used as the result type (does not happen when it's used for a parameter of the function).
It does work (not display the error) when explicitly specifying the type like so:

template< typename T >
T f();

template<>
int f<int>() { //< explicit <int> here makes it work
	return 0;
}


Reproducible: Always

Steps to Reproduce:
1. Create new empty C++ project.
2. Create new empty source file.
3. Insert the following code:

template< typename T >
T f();

template<>
int f() { //< Symbol 'f' could not be resolved
	return 0;
}
Comment 1 Markus Schorn CLA 2011-08-23 10:00:50 EDT
Added testcase and fix.
Comment 2 CDT Genie CLA 2011-08-23 10:23:02 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 355304: Argument deduction for explicit function template specialization.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=64c383952a35d928fb255b903e798cadedba2f63