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

Bug 321933

Summary: [f.p.] Bogus "Assignment to itself" error
Product: [Tools] CDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Sergey Prigogin CLA 2010-08-05 18:26:38 EDT
CDT HEAD:

int& func();

#define X func() = 1

void test() {
  X;  // The line is marked: Assignment to itself 'X'
}
Comment 1 Elena Laskavaia CLA 2010-08-05 22:53:46 EDT
did not know you can write programs like this... 

Simpler case
#define X a = 1

main(){
  X;
}
Comment 2 Sergey Prigogin CLA 2010-08-06 12:38:05 EDT
(In reply to comment #1)

This is not the actual code on which I encountered the problem initially. The problem affects assertion macros of googletest (http://code.google.com/p/googletest/) framework.
Comment 3 Elena Laskavaia CLA 2010-08-06 21:53:57 EDT
fixed on head (8.0) test case added