Peter VARGA
Peter VARGA

Reputation: 5186

How to suppress "Syntax error" in Eclipse 4.7.3a

This std::visit example is not understood by Eclipse CDT yet but it compiles fine with a C++17 compiler.

I mean these lines:

template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;

Eclipse marks these two lines and displays "Syntax error". I was digging through Eclipse settings but I don't find any @suppress directive which would simple suppress a "Syntax error".

My question:
Is the a way how to suppress a "Syntax error"?


The settings Preferences | C/C++ | Code Analysis contain these sections:

The last section contains a more detailed description of an error which can be disabled or suppressed.
Would this section contain "Syntax Error" as it is displayed in the editor then my question doesn't exist. Especially, knowing the CDT cannot be always up-to-date this would help.

Upvotes: 1

Views: 934

Answers (2)

Peter VARGA
Peter VARGA

Reputation: 5186

The answer from HighCommander4 disables - as I commented - all "Syntax Error" markers which is not intended.

So, for the moment there is no solution to achieve this.

I opened a ticket as HighCommander4 suggested and may be it will be implemented in one of the comming Eclipse updates.

Upvotes: 0

HighCommander4
HighCommander4

Reputation: 52749

There is no mechanism to suppress an individual syntax error (@suppress is a mechanism specific to CodAn (code analysis) errors).

You could suppress all syntax errors by going to Preferences | General | Editors | Text Editors | Annotations, selecting C/C++ Indexer Markers (this is the kind of marker created for syntax errors), and unchecking some or all of the check boxes there.

Upvotes: 1

Related Questions