Bug 71331 - [SymbolTable] undefined 'this' in templated member function
Summary: [SymbolTable] undefined 'this' in templated member function
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Andrew Niefer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-03 17:23 EDT by Victor Lenet CLA
Modified: 2004-08-11 16:05 EDT (History)
0 users

See Also:


Attachments

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