Community
Participate
Working Groups
Build Identifier: 20110916-0149 For the appended code, CDT shows a "semanic error" in line 16 of main.cpp although there is none. (Code builds fine, even no warnings.) Reproducible: Always Steps to Reproduce: 1. Import Project 2. Have a look
Created attachment 207212 [details] Source code
Hi Michael, I tested the project with CDT 8.0.0, 8.0.1 and the latest 8.1 (master) on Windows and 8.0.1 on Linux and couldn't reproduce the problem. Can you try rebuilding the index by right-clicking on the project, Index, Rebuild?
Hi Marc-Andre, thanks, this does indeed help. But before I close the bug, do you have an explanation why the index hasn't been rebuild automatically? I'm quite sure that while trying to get rid of the error, I modified each of the three source files several times. Shouldn't any "index" be automatically updated in that case?
(In reply to comment #3) > Hi Marc-Andre, thanks, this does indeed help. But before I close the bug, do > you have an explanation why the index hasn't been rebuild automatically? I don't have an explanation sorry. > I'm > quite sure that while trying to get rid of the error, I modified each of the > three source files several times. Shouldn't any "index" be automatically > updated in that case? Yes the index should be updated automatically when files are saved. We should try to find in which case it is not being updated properly. I tried commenting out the enum an uncommenting it but that worked correctly.
It turns out that it is rather easy to reproduce. Manually (by editing) rename the enumeration type e.g. from "t_iniMode" to "e_iniMode". First in the .h-file in the declaration and in the constructor (parameter's type) and save. Then go to the cpp-file and find the constructor parameter and the case label being marked (correct). Edit the type of the constructor's parameter. The error marker at this line goes away as expected, but the case labels remain being marked! Program compiles fine, of course, but markers at labels won't go away. To get an erroneous marker in main.cpp, simply declare a new variable of type e_iniMode and initialize it with e.g. INIT_ZEROS. Note that no completions are offered. When having typed everything, e_iniMode is accepted as a type (no error indication) but INIT_ZEROS remains as "cannot be resolved".
Thank you for finding the repro steps. I can reproduce this on 8.0.1 but not master (8.1). I tracked down the commit, this was fixed part of bug 356057. *** This bug has been marked as a duplicate of bug 356057 ***