Bug 71331

Summary: [SymbolTable] undefined 'this' in templated member function
Product: [Tools] CDT Reporter: Victor Lenet <victor.lenet>
Component: cdt-parserAssignee: Andrew Niefer <aniefer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Victor Lenet CLA 2004-08-03 17:23:26 EDT
C/C++ Indexer Problem: Syntax error encountered in 
file: /usr/include/c++/3.3.1/memory on line: 349.

The following code snippet points to the problem:

class A {
public:
    int f() {return 1;}

    template <typename T2>
    int g(T2* t2) {
	return (this->f());
    }               ^^
}

For templated member functions implicit parameter 'this' has not been added to 
the symbol table. Therefore dereferencing 'this' yields a syntax error.
Comment 1 Andrew Niefer CLA 2004-08-11 16:05:01 EDT
fixed in head and branch.

I'm not totally happy with the type of the this pointer when the class is a 
template class.  see bug 71827.