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 244777 - Code assistance sometimes flags valid C++11 as errors
Summary: Code assistance sometimes flags valid C++11 as errors
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on: 246332 246349
Blocks:
  Show dependency tree
 
Reported: 2014-05-29 05:36 UTC by markt1964
Modified: 2014-09-18 11:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample C++11 code that illustrates bugs (1.53 KB, text/plain)
2014-05-29 05:36 UTC, markt1964
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markt1964 2014-05-29 05:36:52 UTC
Created attachment 147492 [details]
Sample C++11 code that illustrates bugs

Several things in C++11 do not seem to be correctly recognized by the Netbeans Code Assistance, and will result in unresolved identifier messages, although the code will still compile cleanly.  Sometimes, explicitly reparsing the project will resolve many of these issues, but for certain cases, no amount of reparsing will make the errors go away.

I've supplied a modest full working example class that illustrates all of the problems, with inline comments indicating where code assistance seems to consistently fail. I figured a full working example would be helpful because it illustrates not only exactly what parts do not work, but also reveals some inconsistency in how particular features work.

1) Code assistance refuses to recognize the .target() method of std::function.  In fact, none of std::function's members or types seem to be visible to it.

2) Templated classes declared as friends do not always seem to be able to access private or protected data members... although this is inconsistent - in some cases, it works and in others it does not.  There are examples of both in the attached code sample.  The case where it does not work is indicated by a comment in the attached code.

3) Declaring variables in a lambda that is being passed to a constructor which takes an std;:function seems to result in unresolved identifier messages.

With C++11 enabled, the code fragment I've attached compiles as expected, but Netbeans code assistance stiil insists that the above are errors.

I am using Netbeans 8.0 on Linux, and am using gcc 4.8.2
Comment 1 Alexander Simon 2014-05-29 05:49:58 UTC
Several code model failures
Comment 2 Quality Engineering 2014-08-10 01:50:46 UTC
Integrated into 'main-silver', will be available in build *201408100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/af8d29c3d430
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #244777 - Code assistance sometimes flags valid C++11 as errors
Comment 4 Quality Engineering 2014-08-12 02:31:36 UTC
Integrated into 'main-silver', will be available in build *201408120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/548829bab5a0
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Additional fix for #244777 - Code assistance sometimes flags valid C++11 as errors
-- added restoring of lambdas declared inside initializers
Comment 5 Quality Engineering 2014-09-17 12:15:53 UTC
Integrated into 'releases/release801', will be available in build *201409171118* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/cd243a95be94
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #244777 - Code assistance sometimes flags valid C++11 as errors
(transplanted from af8d29c3d4307013f5cfcbfeed5cfd79bde4c93a)
Comment 6 soldatov 2014-09-18 11:12:07 UTC
Verified in NetBeans 8.0.1 patch1

-------------------------------------------------------------------------------
>Log Session: Thursday, September 18, 2014 2:47:00 PM MSK
>System Info: 
  Product Version         = NetBeans IDE 8.0.1 (Build 201409180010) (#ef6e99d0c0db)
  Operating System        = SunOS version 5.11 running on amd64
  Java; VM; Vendor        = 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.8.0_05-b13
  Java Home               = /usr/jdk/instances/jdk1.8.0/jre
  System Locale; Encoding = en (nb); UTF-8