| Summary: | Erroneous "unresolved symbol" in explicit template specialization | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | sangar |
| Component: | cdt-parser | Assignee: | 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.1.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Added testcase and fix. *** 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
|
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; }