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

Bug 314402

Summary: cdt does not return the correct binding based on the includes.
Product: [Tools] CDT Reporter: shanbala
Component: cdt-parserAssignee: Project Inbox <cdt-parser-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: pavan.ananth, sanjesh.nair, shanbala, yevshif
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description shanbala CLA 2010-05-26 03:50:37 EDT
Build Identifier: 

Found the issue during the usage of the API : isExplicitSpecialization() on a PDOMCPPClassInstance.

Consider the following scenario : 

File : "A.h"

template<class T>
class A{

};

File : "B.h"

#include "A.h"
template<>
class A<int>{

};

File : "C.h"

#include "A.h"
class C{
A<int> attr1;
};

In this case, the type of the attribute attr1 should be resolved to a template instance binding and not the specialized template class binding(as "A.h" is included). The only way to find out the binding that is returned is through the API - isExplicitSpecialization(). 

But in the above stated case, the API always returns true, which means that the binding is resolved based on includes(A.h is included here) and the specialized template class binding is always returned here.

i.e inclusion of A.h or B.h always returns a specialized template class binding.

The bindings(of a template instance/ specialized template class) should be returned based on the inclusion.

Reproducible: Always