Search code examples
c++eclipseeclipse-cdtc++17

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:

  • Coding Style
  • Potential Programming Problems
  • Security Vulnerabilities
  • Syntax and Semantic Erros

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.


Solution

  • 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.