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

Bug 367997

Summary: Error with partial template specialization and default template parameters
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.1.0   
Target Milestone: 8.1.0   
Hardware: All   
OS: All   
Whiteboard:

Description Nathan Ridge CLA 2012-01-05 19:36:14 EST
In the following code:

template <typename>
class A {};

template <typename, typename = void>
struct B {};

template <typename T>
struct B<A<T>>
{
    typedef int type;
};
    
int main()
{
    typedef B<A<int>>::type type;  // ERROR HERE
}

CDT gives an error at the indicated line: "Type 'B<A<int>>::type' could not be resolved".

GCC compiles the code fine.
Comment 1 Markus Schorn CLA 2012-01-09 05:54:32 EST
Thanks, added testcase and fix.
Comment 2 CDT Genie CLA 2012-02-29 13:21:08 EST
*** cdt git genie on behalf of Markus Schorn ***

    Bug 367997: Partial class template specialization using default arguments.

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