Skip to content
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

Eclipse CDT - Method 'endExpression' could not be resolved #359

Closed
jvitku opened this issue Dec 17, 2014 · 13 comments
Closed

Eclipse CDT - Method 'endExpression' could not be resolved #359

jvitku opened this issue Dec 17, 2014 · 13 comments

Comments

@jvitku
Copy link

jvitku commented Dec 17, 2014

Hi, it seems that (from some, to me unknown reason) the Eclipse is unable to Index the single_include/catch.hpp file. Here is the simple example:

#define CATCH_CONFIG_MAIN
#include "catch.hpp"

unsigned int Factorial( unsigned int number ) {
  return number > 1 ? Factorial(number-1)*number : 1;
}
TEST_CASE( "Factorials are computed", "[factorial]" ) {
    REQUIRE( Factorial(0) == 1 );
}

It compiles and tests OK, but the Eclipse marks all REQUIRE lines as error and complains about Method 'endExpression' could not be resolved.

Tried:

  • adding catch.hpp into Preprocessor Include Paths in eclipse
  • enabled scalability under C++/editor/scalability to 500000 lines
  • rebuilding index, cleaning project, open/close Eclipse..

Setup:

  • OS X 10.8.2
  • g++-4.8
  • Eclipse Juno with CDT

More can be found in Google group

@PureAbstract
Copy link
Contributor

Have you filed a bug report with Eclipse?

@jvitku
Copy link
Author

jvitku commented Dec 17, 2014

OK, I've also felt like this is a problem rather in the Eclipse CDT indexer, so there it is. We'll see.

@RomainGoussault
Copy link

Same issue here

@chvillanuevap
Copy link

@kentsangkm's solution in #393 worked for me on Eclipse Luna.

@RomainGoussault
Copy link

Same here, I tried #393 solution and it worked on Eclipse Luna, Ubuntu

philsquared added a commit that referenced this issue Jun 29, 2015
Allows more complex LHS expressions - and works around an Eclipse bug.
See Issues #359, #393 and #247 for details
@philsquared
Copy link
Collaborator

I know this has been circulating for a while but I felt there was enough of a critical mass to push it to the top recently. I've now changed the decomposition operator to <=, which I believe works around the issue here?

Please let me know either way - and also whether the change introduces any warnings for you?

martinmoene added a commit to martinmoene/lest that referenced this issue Jul 22, 2015


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
@horenmar horenmar added the Resolved - pending review Issue waiting for feedback from the original author label Jan 16, 2017
@horenmar horenmar closed this as completed Feb 5, 2017
@horenmar horenmar removed the Resolved - pending review Issue waiting for feedback from the original author label Feb 5, 2017
@manu-m
Copy link

manu-m commented Apr 25, 2017

The problem exists since version 1.7.1 again. Is there a chance to "fix" it again in Catch, although in real it is an eclipse problem?

@horenmar
Copy link
Member

@manu-m Are you sure its since 1.7.1? Because that one didn't touch the decomposition mechanism. If it started again since 1.7.0, then maybe.

@manu-m
Copy link

manu-m commented Apr 26, 2017

@horenmar Yes I am sure. I checked it two times again. The message doesn't appear in eclipse while working with Catch 1.7.0 but appears while working with 1.7.1. I am surprised, too.

@horenmar
Copy link
Member

@manu-m In that case, probably not. 1.7.0 brought a rework of the expression capture mechanism, which sped up successful assertions significantly (~5 times). 1.7.1 then was a bugfix, so that templated comparisons don't cause compile-time errors.

Maybe we can try to change the underlying operator again, but not sure if that would help.

@horenmar
Copy link
Member

@manu-m Try the attached version.

catch.zip

@manu-m
Copy link

manu-m commented Apr 27, 2017

@horenmar Thank you very much for your extremly fast reply! But unfortunately the attached version still produces the error. Do have another idea or solution related to this problem?

@horenmar
Copy link
Member

@manu-m Well, Eclipse could always fix their parser 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants