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 134614

Summary: Find Usages don't find macros that are concatenated (using #) from other macros
Product: cnd Reporter: Vladimir Kvashin <vkvashin>
Component: Code ModelAssignee: Vladimir Voskresensky <vv159170>
Status: NEW ---    
Severity: blocker    
Priority: P4    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Vladimir Kvashin 2008-05-06 15:03:18 UTC
Find Usages can not find macros that are concatenated (via # operator) from other macros
See the example below. There are two usages of the MINMAX macro in the code.
But only 1-st one is found.

#define MIN(a, b) ((a < b) ? (a) : (b))
#define MAX(a, b) ((a > b) ? (a) : (b))
#define MINMAX(a, b) MIN(a, b) + MAX(a, b)
#define MERGE(a, b, c, d) a##b(c, d)

void foo() {
    int i = MINMAX(1, 2); // MINMAX is found here
    int j = MERGE(MIN, MAX, 3, 4); // but MINMAX wasn't found here!
}
Comment 1 Vladimir Kvashin 2008-05-06 15:07:15 UTC
There is another issue, which, I believe is tightly connected (if not, please file another issue).
In the same example, MIN is found in the line 
    int j = MERGE(MIN, MAX, 3, 4);
But there is no usage of MIN there.
Comment 2 Alexander Pepin 2010-10-27 13:30:42 UTC
It's not targeted to the current release.