-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolved #359 - Eclipse CDT - Method 'endExpression' could not be resolved #393
Conversation
Eclipse indexer did not handle the ->* operator correctly and display error in the editor, whereas it actually is not a bug. Changing the operator from operator->* to operator+ can resolve this problem. Proof of concept: Prority 3 operator+ Right-to-left Prority 4 operator->* Left-to-right where: __catchResult+expr Supported operator in expr: Prority 3 + Prority 3 - Prority 3 / Prority 3 * Prority 13 && *STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison Prority 14 || *STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison __catchResult + _1Obj operand1 _2Obj .... _NObj => (__catchResult + _1Obj) operand1 _2Obj .... _NObj => ExpressionLhs<T> operand1 _2Obj .... _NObj Hence, the change is OK
I tried this and it worked on Eclipse Luna. |
Same here, I tried this and it worked on Eclipse Luna, Ubuntu |
This worked great for me in Windows/Luna. Thank you! Hope it gets pulled into master soon. |
This seems to be a workaround for what appears to be a bug in Eclipse - has anyone raised a bug with the Eclipse folks? |
works on Eclipse Luna, Ubuntu:
|
As @PureAbstract says, this is a workaround for an IDE shortcoming. That's not to dismiss it - but there are some other consequences to such a change. Alternatively, one of the non-equality comparison operators would also do the trick (e.g. If there are warnings with Thoughts? |
perhaps via http://stackoverflow.com/questions/3030099/pragma-in-define-macro |
Well well. I didn't know about that one. Thanks @martinmoene!
works for me in clang. I'm not sure how to use it portably, though. It's now got incompatibilities on two axes (_Pragma is C++11, AFAICS - and then the pragma itself is clang specific)! |
But do other compilers have the problem that calls for the pragma? Hold on, scrap the second line, it has to be more sophisticated than that...
|
This enables the use of *, /, %, + and - at the LHS of expressions used in assertion macros, e.g. EXPECT( 1 + 2 == 3 ) See also discussion at - Catch commit: Use <= operator instead of ->* for decomposer, catchorg/Catch2@8cc1108 and issues mentioned there: - Catch issue #359, catchorg/Catch2#359 - Catch issue #393, catchorg/Catch2#393 - Catch issue #247, catchorg/Catch2#247
Eclipse indexer did not handle the ->* operator correctly and display error in the editor, whereas it actually is not a bug. Changing the operator from operator->* to operator+ can resolve this problem.
Proof of concept:
Priority 3 operator+ Right-to-left
Priority 4 operator->* Left-to-right
where:
__catchResult+expr
Supported operator in expr:
Prority 3 +
Prority 3 -
Priority 3 /
Priority 3 *
Priority 13 && *STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison
Priority 14 || *STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison
__catchResult + _1Obj operand1 _2Obj .... _NObj
=> (__catchResult + _1Obj) operand1 _2Obj .... _NObj
=> ExpressionLhs operand1 _2Obj .... _NObj
Hence, the change is OK