Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370146

Summary: No references in class defined in file containing inactive code that references a macro
Product: [Tools] CDT Reporter: Marc-André Laperle <malaperle>
Component: cdt-indexerAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, eclipse.sprigogin, yevshif
Version: 8.1.0   
Target Milestone: 8.1.0   
Hardware: All   
OS: All   
Whiteboard:

Description Marc-André Laperle CLA 2012-01-30 12:14:12 EST
Using 8.1.0.201201271714 (but I've seen this for months, just found solid repro)

test.cpp:

class Bar
{
    void func();

    int field;
};

void Bar::func()
{
    field;
    func();
}

#if 0

MY_MACRO

#endif

1. Add MY_MACRO to Symbols in project properties
2. Find references on 'field' or 'func'.
3. No references are found. 

If you remove or comment out MY_MACRO, references are found. Also, if the code is in a header, it works.
Comment 1 Marc-André Laperle CLA 2012-02-01 03:02:51 EST
Also happens on 8.0.1.
Comment 2 Marc-André Laperle CLA 2012-02-08 02:50:23 EST
(In reply to comment #1)
> Also happens on 8.0.1.

Uhh, now it's working on 8.0.1, maybe I tested that wrong and put it in the header and didn't include it.

If I comment count the significant macro stuff in PDOMFile.Finder.compare then it works again so it looks like it might be a regression introduced with bug 197989.
Comment 3 Marc-André Laperle CLA 2012-02-08 03:05:33 EST
(In reply to comment #2)
> If I comment count

I meant comment out.
Comment 4 Marc-André Laperle CLA 2012-03-07 20:08:21 EST
Tested again with 8.1.0.201203060448.
Comment 6 CDT Genie CLA 2013-02-27 11:43:18 EST
*** cdt git genie on behalf of sprigogin ***

    Bug 370146 - No references in class defined in file containing inactive
    code that references a macro

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=65a29165c20d6a4546853eee11fd88eafb2250f6