Bug 314402 - cdt does not return the correct binding based on the includes.
Summary: cdt does not return the correct binding based on the includes.
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 03:50 EDT by shanbala CLA
Modified: 2020-09-04 15:25 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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