Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357320 - Incorrect "Member declaration not found" in template class
Summary: Incorrect "Member declaration not found" in template class
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0.2   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-11 00:48 EDT by Geoff Alexander CLA
Modified: 2011-09-19 08:23 EDT (History)
2 users (show)

See Also:


Attachments
Eclipse workspace containing small example illustrating the problem (789.75 KB, application/x-compressed-tar)
2011-09-11 00:48 EDT, Geoff Alexander CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Alexander CLA 2011-09-11 00:48:17 EDT
Created attachment 203119 [details]
Eclipse workspace containing small example illustrating the problem

I've attached an Eclipse workspace containing a small example illustrating the
problem. In this example, the template class C1 compiles just fine.  However, CDT is incorrectly reporting a "Member declaration not found":

Description	Resource	Path	Location	Type
Member declaration not found	C1.tpl	/Example/include	line 5	Semantic Error
Comment 1 Markus Schorn CLA 2011-09-16 05:41:17 EDT
Thanks, the example can be simplified to:

// a.h
template<class T> struct C1 {
    typedef int iterator;
    iterator m1();
};

// a.cpp
template<class T> typename C1<T>::iterator C1<T>::m1() {
   return 0;
}
Comment 2 Markus Schorn CLA 2011-09-16 06:58:20 EDT
Added testcase and fix.
Comment 3 CDT Genie CLA 2011-09-16 07:23:02 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 357320: Class template usage in method definded outside of class body.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=b9e57bcf8c1aa970a02e72c7dc9d566de6854ee1
Comment 4 CDT Genie CLA 2011-09-19 08:23:07 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 357320: Class template usage in method defined outside of class body.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=1772ed2b5581051baa97510429a0719d3ca51cec