Community
Participate
Working Groups
Created attachment 205779 [details] Eclipse workspace containing small example illustrating the problem
Build Identifier: 20110916-0149 We sometimes have two sequential macro usages as in the following code: public: inline bool operator!=(const Term& r) const { LLTP_ASSERT1((_type == function) || (_type == variable)); LLTP_ASSERT1((r._type == function) || (r._type == variable)); return !(*this == r); } Under Eclipse CDT 8.0 this formats incorrectly on the first format: public: inline bool operator!=(const Term& r) const { LLTP_ASSERT1((_type == function) || (_type == variable)); LLTP_ASSERT1((r._type == function) || (r._type == variable)); return !(*this == r); } A second format gives public: inline bool operator!=(const Term& r) const { LLTP_ASSERT1((_type == function) || (_type == variable));LLTP_ASSERT1((r._type == function) || (r._type == variable)); return !(*this == r); } I've attached an Eclipse workspace containing a small example illustrating the problem.
Looks like the problem is related to the macro having an empty expansion.
Thanks Nathan. Based on your comment, I'm able to work around the problem by using the # Symbols tab of the C/C++ General -> Paths and Symbols preferences to ensure that the problematic macros aren't empty. However, even though I'm able to work around the problem, I still think that this problem should be fixed.
Agreed - this is a bug in the formatter.
New Gerrit change created: https://git.eclipse.org/r/138425
Gerrit change https://git.eclipse.org/r/138425 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d1bd979a00673bcb6fcaa001200ee32cf3def041
Thank you for the fix Marco!