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

Clion highlights TEST_CASE and SECTION as spurius syntax errors #484

Closed
cossio opened this issue Aug 17, 2015 · 9 comments
Closed

Clion highlights TEST_CASE and SECTION as spurius syntax errors #484

cossio opened this issue Aug 17, 2015 · 9 comments

Comments

@cossio
Copy link

cossio commented Aug 17, 2015

I don't know why this happens, but if I have a .cpp files with more than one TEST_CASE, the second TEST_CASE and all that follow are highlightes as syntax errors in CLion IDE, even if the code compiles well.

@rollbear
Copy link

There's a bug report that CLion doesn't respect the __LINE__ macro, which causes this kind of problem for pretty much all C++ unit test and mocking frameworks.

See https://youtrack.jetbrains.com/issue/CPP-2801 for details.

There's another report for the __COUNTER__ macro.

https://youtrack.jetbrains.com/issue/CPP-820

@cossio
Copy link
Author

cossio commented Aug 17, 2015

Oh, so it's a problem with CLion, not Catch. Good to know. Hope they fix it. Thanks for your reply.

@cossio cossio closed this as completed Aug 17, 2015
@cossio cossio reopened this Aug 17, 2015
@rollbear
Copy link

You may want to +1 and/or star mark them to give Jetbrains your sense of urgency.

@ghost
Copy link

ghost commented Jun 10, 2016

Is this still an issue with Clion? (CPP-2801 at Jetbrains tracker states fixed). Is it more an annoyance and are you still able to use Clion and Catch together productively?

@horenmar
Copy link
Member

horenmar commented Jan 11, 2017

@russdamerell The original author is currently using CLion to work on Catch, so I'd say it is ok.

Not sure if there is still problem with __COUNTER__ macro, CPP-820 is still open and Catch prefers to use it if possible.

@horenmar horenmar added the Resolved - pending review Issue waiting for feedback from the original author label Jan 11, 2017
@philsquared
Copy link
Collaborator

philsquared commented Jan 23, 2017

An update on this.
At time of writing Clion still has a problem with __COUNTER__ - so if Catch detects that it can use it there are still issues.

Here's the three stage approach for dealing with this:

  1. In the immediate term if you have these issues define CATCH_CONFIG_NO_COUNTER for your project.
  2. The next release of CLion should have an identifier that is #defined during the IDE parsing stage and Catch will automatically disable use of __COUNTER__ when this is set (so you shouldn't need the workaround in (1) above).
  3. I know, from internal discussion, that the __COUNTER__ issue will be fixed in he mid-term future. That's not on the public roadmap yet, so I can't say when, but for our purposes here (2), above, should be enough for us.

Once the CLion identifier workaround in (2) is released I'll close this.

@horenmar
Copy link
Member

horenmar commented Mar 8, 2017

Can someone confirm that the new CLion version is OK now?

@philsquared
Copy link
Collaborator

The latest CLion EAP version is ok now. But that won't be released as an official version until the end of the month, so I'm inclined to leave this open until then.

https://blog.jetbrains.com/clion/2017/03/clion-2017-1-eap-disassembly-view-catch-msvc-changes/

@horenmar
Copy link
Member

New CLion was released, so this should be ok now.

@horenmar horenmar removed the Resolved - pending review Issue waiting for feedback from the original author label Mar 29, 2017
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

4 participants