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

Bug 333186

Summary: Recognition of an inner type of a type derived from template.
Product: [Tools] CDT Reporter: Konstantin Stupnik <konstantin.stupnik>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: CLOSED DUPLICATE QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif
Version: 7.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Konstantin Stupnik CLA 2010-12-24 05:53:32 EST
Here is example:

template <class T>
struct TestTmpl{
  struct Inner1;
  struct Inner2{
    Inner1* ptr1;
  };
  struct Inner1{
    Inner2* ptr2;
  };
};

struct TestImpl:TestTmpl<int>{};

void func(TestImpl::Inner1* ptr1)
{
  TestImpl::Inner2* ptr2=ptr1->ptr2;
  func(ptr2->ptr1);
}

Call to func is colored as 'problem'.
Jump to definition jumps to this function only if it is not overridden.
However, both ptr1 and ptr2 are handled by code assistant correctly.
It looks like CDT do not recognize that TestImpl::Inner1* and TestTmpl<int>:Inner1* are the same types.
Comment 1 Markus Schorn CLA 2011-01-07 05:16:03 EST
This is a different example for bug 329795. I have added it as a testcase.

*** This bug has been marked as a duplicate of bug 329795 ***