| Summary: | Fields of partially specialized types declared in headers fail to resolve | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Kory Markevich <vulcannis> |
| Component: | cdt-core | Assignee: | Project Inbox <cdt-core-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Doug Schaefer <cdtdoug> |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Forgot to mention, looks like it may be related to bug 214017. I cannot reproduce the issue. I have tried with CDT 8.0 and the latest version on the master branch. What version of CDT are you using? Version: 8.0.0.201106081058 Build id: 201106081058 Eclipse 4.1.0 (I20110620-1631.) I just tried the sample code in a new, clean project and it worked fine. It fails as described when I use it in one of my existing projects. Must be some project-level config issue but I'm not sure what it would be. You can try to rebuild the index for the project. If that does not help, please try to make the issue reproducable for me and reopen the bug with a small sample project. |
Build Identifier: I20110620-1631 The marked lines in the following code are marked with field resolution errors. As shown, there are no errors if they are declared in the source file itself rather than a header file. Test.h -------- template < typename T, int c > class A { }; template < typename T > class A< T, 1 > { T v; }; struct B { A< int, 1 > f; }; extern A< int, 1 > b; Test.cpp -------- #include "Test.h" struct C { A< int, 1 > f; }; void f( ) { A< int, 1 > a; a.v = 1; // No error C d; d.f.v = 1; // No error b.v = 1; // Error: Field 'v' could not be resolved B c; c.f.v = 1; // Error: Field 'v' could not be resolved } Reproducible: Always