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 241795 - No suggestion in nested namespace
Summary: No suggestion in nested namespace
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.0
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 08:00 UTC by nordsturm
Modified: 2014-04-22 16:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nordsturm 2014-02-13 08:00:18 UTC
I've reproduced the bug using this very easy example:

#include <string>
#include <boost/shared_ptr.hpp>

// This is a condition to reproduce - write
// 'using' directive separately, in my case it was a header file.
// The example works with a single source file too.
namespace  abc
{
using boost::shared_ptr;
}


// And there are code examples which make code suggestion works or not.
namespace abc
{

void f()
{
  shared_ptr<std::string> sptr(new string("text"));

  /// OK!
  sptr->
}

namespace def
{

void f()
{
  shared_ptr<std::string> sptr(new string("text"));

  /// FAIL! NO SUGGESTION!
  sptr->
}

}

}
Comment 1 petrk 2014-02-24 17:47:24 UTC
More simple test case (from bug 235102). Seems the problem is the same. Maybe this bug should be marked as duplicate of 235102 (but since 235102 is quite vague, it is better to keep this bug separated from 235102).

=====================================================
namespace A {
    struct AAA {
        int foo();
    };
    
}

namespace B {
    using namespace A;
}

namespace B {
    namespace C {
        AAA x;
        
        int function() {
            x.foo(); // foo is unresolved
        }
    }
} 
=====================================================