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 249613 - Code assistance fails for some inline namespaces
Summary: Code assistance fails for some inline namespaces
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.0.2
Hardware: PC Other
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-03 21:05 UTC by sperber
Modified: 2015-02-25 10:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Assistance trouble (13.04 KB, image/png)
2015-01-03 21:05 UTC, sperber
Details
Test project (5.95 KB, application/x-bzip-compressed-tar)
2015-01-03 23:17 UTC, sperber
Details
screenshot (175.35 KB, image/png)
2015-01-04 09:48 UTC, soldatov
Details
Netbeans include screenshot (18.08 KB, image/png)
2015-01-04 10:05 UTC, sperber
Details
chrono header (35.78 KB, application/octet-stream)
2015-01-04 10:06 UTC, sperber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sperber 2015-01-03 21:05:54 UTC
Created attachment 151350 [details]
Assistance trouble

Although marked as fixed in bug 226941 there still seems to be a problem with Code Assistance and some namespaces (with and without -J-Dcnd.modelimpl.expression.evaluator.deep.variable.provider=true )

The following code causes troubles:

#include <chrono>
#include <thread>

int main()
{
  std::chrono::milliseconds sleepTime( 10 );
   
  std::this_thread::sleep_for( sleepTime );  
  
  return 0;  
}


The attached screenshot shows the behavior.
Comment 1 soldatov 2015-01-03 22:52:41 UTC
I can't reproduce your problem. In issue 229641 user had not problem with std::chrono too (see https://bugzilla-attachments-229641.netbeans.org/bugzilla/attachment.cgi?id=134349).
Do you use c++11 flag in order to setup project?
Comment 2 sperber 2015-01-03 23:17:04 UTC
Created attachment 151351 [details]
Test project
Comment 3 sperber 2015-01-03 23:19:38 UTC
Yes the project is set to C++11 (see attachment)

Sorry - I pasted the wrong bug number - i meant 236290 which is marked as duplicate of 230760 which is marked as fixed.

I've attached my test project - maybe that helps.
Comment 4 soldatov 2015-01-04 09:48:09 UTC
Created attachment 151354 [details]
screenshot

I see you use CLang 3.4 and unknown (for NetBeans) platform. Which OS you use? Can you press Ctrl+Alt and move mouse on "#include <chrono>" (see screenshot)? On Windows or Linux a CLang++ compiler use GCC header files, but it is not a universal rule.
Comment 5 sperber 2015-01-04 10:04:50 UTC
I use FreeBSD 10.1 which uses llvm headers.

I'll attach the chrono header and a screenshot for the chrono-include.
Comment 6 sperber 2015-01-04 10:05:52 UTC
Created attachment 151355 [details]
Netbeans include screenshot
Comment 7 sperber 2015-01-04 10:06:28 UTC
Created attachment 151356 [details]
chrono header
Comment 8 soldatov 2015-01-17 16:50:04 UTC
confirmed.
Default FreeBSD has problem with std::chrono
Comment 9 soldatov 2015-01-17 18:06:28 UTC
Such code confuses parser:

namespace A {
    inline namespace __1 {
        namespace B {

            void foo() {
            }
        }
    }
}

int main() {
    A::B::foo();
    return 0;
}
Comment 10 petrk 2015-01-21 19:14:53 UTC
Fixed in http://hg.netbeans.org/cnd-main/rev/9cfc72b96460
Comment 11 petrk 2015-01-21 19:18:07 UTC
Though, I must say that the bug is partly fixed - IDE will recognize namespaces inside inlined namespaces but they will not be listed in code completion list (i.e. navigation to symbols will work but autocompletion won't).
Comment 12 Quality Engineering 2015-01-22 03:58:13 UTC
Integrated into 'main-silver', will be available in build *201501220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9cfc72b96460
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #249613 - Code assistance fails for some inline namespaces
Comment 13 soldatov 2015-02-24 11:12:32 UTC
verified in trunk

>System Info: 
  Product Version         = NetBeans IDE Dev (Build 201502240532) (#d6aa48dbbbfb)
Comment 14 soldatov 2015-02-25 10:19:35 UTC
verified in NetBeans IDE 8.0.2 (Build 201502242207)