| Summary: | typedef enum removed from index after changes in header file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Axel Mueller <aegges> | ||||
| Component: | cdt-indexer | Assignee: | Markus Schorn <mschorn.eclipse> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> | ||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | cdtdoug, florian.reinhard, mnl, pouhan | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | 8.1.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I raised the importance of this bug. We use a lot of typedefed enums in our code and every update of a header file (CVS or local changes) will corrupt the index. Created attachment 202859 [details]
Sample project
1) Import the sample project
2) Open Hello.cpp => there should be no CODAN errors
3) Open Hello.h and comment out line 5 (#define mytest 1) and save
4) switch to Hello.cpp => CODAN error ("Symbol AE_OFF could not be resolved")
5) rebuild index => everything is fine
6) uncomment line 5 again and put it at the end of the header (after mystruct declaration); rebuild index (just to be sure we have everything)
7) comment out #define mytest 1 again and save
8) switch to Hello.cpp => no error, everything is fine
As a note, the mytest define should have no effect at all!
Added testcase and fix. *** cdt git genie on behalf of Markus Schorn ***
Bug 356057: Updating unnamed enumerations.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ad4729d9540897568c8ffe576f7e465ef21da400
(In reply to comment #3) > Added testcase and fix. Fine. Too late for Indigo SR1? (In reply to comment #5) > Fine. Too late for Indigo SR1? Yes, it is too late for SR1. It is also a problem to fix the issue for SR2, because I had to change the index layout, which I cannot do on the maintenance branch. At least CDT 7.0.2 has the same issue (I have not checked earlier versions), the fix in the next major release may be sufficient. (In reply to comment #6) > At least CDT 7.0.2 has the same issue (I have not checked earlier versions), > the fix in the next major release may be sufficient. I never encountered this problem with 7.0.2 (official build from 201102110609)! The problem arised after the update to Indigo. (In reply to comment #7) > I never encountered this problem with 7.0.2 (official build from 201102110609)! It may be the case that codan did not report the problem, or that you did not use codan with 7.0.2. > The problem arised after the update to Indigo. Why can I reproduce it with 7.0.2? (In reply to comment #8) > (In reply to comment #7) > > I never encountered this problem with 7.0.2 (official build from 201102110609)! > It may be the case that codan did not report the problem, or that you did not > use codan with 7.0.2. Bingo. Codan was deactivated. (In reply to comment #3) > Added testcase and fix. Is bug #171193 related to this one? This bug is still reproduceable with the sample project on cdt 8.0.x with one small change:
just wrap the typedef enum in
extern "C"
{
typedef enum....
}
*** Bug 361899 has been marked as a duplicate of this bug. *** *** Bug 364138 has been marked as a duplicate of this bug. *** |
Build Identifier: 20110609-2236, CDT 8.0 I have a header file containing the following typedefed enum typedef enum { AE_ON = 0, AE_OFF = 1 } Adaptiv_T; I use these enums in a cpp file. When I change anything in the header file I get a lot of errors in the cpp saying "Symbol 'AE_ON' could not be resolved. I have to rebuild the complete index to get it working again (F3 does not resolve the symbol and the enum is not shown in the Indexer View). This bug was newly introduced in the Indigo release. I never had any problems before the update. Reproducible: Always