This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236435

Summary: [Regression] Unable to resolve all of the identifiers in files with pragma once
Product: cnd Reporter: TomCatFort
Component: Code ModelAssignee: Vladimir Voskresensky <vv159170>
Status: VERIFIED FIXED    
Severity: normal CC: TomCatFort
Priority: P1 Keywords: 7.4_HR_FIX, REGRESSION
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 234730    
Bug Blocks:    
Attachments: Contains a copy of a project with the bug and a screenshot.
simple test case project
patch to fix the problem

Description TomCatFort 2013-09-26 18:59:48 UTC
Created attachment 140519 [details]
Contains a copy of a project with the bug and a screenshot.

In some header files the code completion goes haywire and marks nearly all of the identifiers with the "unable to resolve identifier X" error. This happened in a C++11 Application project.

I tried to replicate the bug with minimal code, but I wasn't able, so I attached my project and a screenshot in a zip file.
In this project the error first appeared in Screen.hpp. Then after some time it started to work again, but the error reappeared in the previously working Error.hpp (see the screenshot).
Regardless of this, the project compiles without any warning or error.

The project has external dependencies on SFML 2.1 and pugixml, but I hope the bug shows itself without them too.

I don't know what triggers this bug or any workarounds for it, but I find this bug a mayor showstopper for NetBeans 7.4.
Comment 1 Vladimir Voskresensky 2013-09-29 14:41:35 UTC
Thanks to Petr for investigation it's regression caused by 
http://hg.netbeans.org/cnd-main/rev/07d17d47b441
Comment 2 Vladimir Voskresensky 2013-09-29 14:48:47 UTC
if header file guarded by pragma once has conditional preproc blocks like
#if ...
#else
...
#endif

then code assistance in such files is completely broken
Comment 3 Vladimir Voskresensky 2013-09-29 14:50:08 UTC
Created attachment 140619 [details]
simple test case project

sample project
Comment 4 Vladimir Voskresensky 2013-09-29 14:56:50 UTC
Created attachment 140620 [details]
patch to fix the problem
Comment 5 soldatov 2013-09-30 08:08:14 UTC
Verified in special build with fix (NetBeans IDE 7.4 RC2 (Build cnd-build-10530-on-20130930))
Comment 6 petrk 2013-09-30 09:06:09 UTC
fix is safe
Comment 7 Vladimir Voskresensky 2013-09-30 13:26:42 UTC
fixed
http://hg.netbeans.org/cnd-main/rev/8083744b4356
Comment 8 Vladimir Voskresensky 2013-09-30 14:01:29 UTC
transplanted:
http://hg.netbeans.org/releases/rev/b047f8860636
Comment 9 Quality Engineering 2013-10-01 02:00:45 UTC
Integrated into 'main-silver', will be available in build *201310010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8083744b4356
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed #236435 - [Regression] Unable to resolve all of the identifiers in files with pragma once
- separate handling for stop conditions: #error vs. #pragma once
(transplanted from d9e651e66655c1040c1d6719537444058064f831)
Comment 10 soldatov 2013-10-01 10:50:07 UTC
verified in NetBeans IDE 7.4 RC2 (Build 201309302222)