Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328392

Summary: Errors in non-self-contained header files go away if opened in editor
Product: [Tools] CDT Reporter: Jens Elmenthaler <jens.elmenthaler>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: NEW --- QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif, zeratul976
Version: 7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jens Elmenthaler CLA 2010-10-21 14:20:34 EDT
Build Identifier: HEAD

Create files with the following content:

// workorder.hpp
Workorder doSomething();

// workorder.cpp
class Workorder {

};

#include "workorder.hpp"

Run the code analysis on the containing project. An error in workorder.hpp is reported, saying Workorder cannot be resolved.

In the problems view, double-click the error. An editor opens, an now the error vanishes.

One could argue whether there should be an error reported or not, after all every compiler will accept the code. Nevertheless, header files that are not self-contained should be considered very bad style. So I would prefer that those problems are consistently reported as errors.


Reproducible: Always
Comment 1 Nathan Ridge CLA 2013-08-24 18:01:04 EDT
I don't even see the error initially.