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

Bug 326768

Summary: Macro name is reported as unresolved symbol, not the actual symbol after macro expansion
Product: [Tools] CDT Reporter: Jens Elmenthaler <jens.elmenthaler>
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, eclipse.sprigogin, malaperle
Version: 7.0   
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:

Description Jens Elmenthaler CLA 2010-10-01 07:43:45 EDT
Build Identifier: HEAD

Consider the following code example:

#include <iostream>
//using namespace ::std;

#define ENTER() cout << "Entering" << endl;

void testSomething()
{
  ENTER();
}

As long as the using directive is commented out, the code will not compile. Codan marks it correctly as an error, but it says "Symbol 'ENTER()' could not be resolved", instead of referring to cout and/or endl.

Reproducible: Always
Comment 1 Elena Laskavaia CLA 2011-02-23 22:15:46 EST
fixed
Comment 2 CDT Genie CLA 2011-02-23 22:23:28 EST
*** cdt cvs genie on behalf of elaskavaia ***
Bug 326768 - Macro name is reported as unresolved symbol, not the actual symbol after macro expansion

[*] ProblemBindingChecker.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ProblemBindingChecker.java?root=Tools_Project&r1=1.5&r2=1.6