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 271349

Summary: Macro with namespace code assistance issue
Product: cnd Reporter: clpaulino
Component: Code ModelAssignee: petrk
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description clpaulino 2017-08-22 17:55:04 UTC
Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_144; Java HotSpot(TM) 64-Bit Server VM 25.144-b01
Runtime: Java(TM) SE Runtime Environment 1.8.0_144-b01

Code assistance does not work when I declare variables within an inner class that is in a macro that is used for a namespace with brackets.

An example of the macro I need is this

#define MY_MACRO(Argument) \
        namespace MyNameSpace##Argument { \
        namespace AnotherNameSpace { \
           inline char const* GetArgument () { \
              return #Argument; \
           } \
        } \
     } \
     namespace MyNameSpace##Argument

I have tested without the nested namespace and only used one. As long as there are brackets associated with the namespace, the issue occurs. An example of the issue is below. The code assistance marks the variables I declare in my method as unable to resolve identifier.

MY_MACRO(Argument)
{
class MyClass
{
public:
   MyClass()
   {
   }

   void MyMethod(const int myInt) // myInt Unresolved
   {
      int newInt = myInt; // newInt and myInt are unresolved
   }
}
}