Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321933 - [f.p.] Bogus "Assignment to itself" error
Summary: [f.p.] Bogus "Assignment to itself" error
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 18:26 EDT by Sergey Prigogin CLA
Modified: 2010-08-06 22:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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