Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » [[maybe_unused]] C++17([[maybe_unused]] Editor says Syntax Error but code compiles)
[[maybe_unused]] C++17 [message #1780878] Mon, 29 January 2018 14:11 Go to next message
Amanda M is currently offline Amanda MFriend
Messages: 2
Registered: January 2018
Junior Member
Hello Everyone,

Version: Photon (4.8): Build id: I20180124-2000
Fedora 27
g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
jre: 9.0.4

I have recently migrated from Netbeans 8.2 to Eclipse 4.8. My software is using the c++17 [[maybe_unused]] attribute to silence -Wunused-parameter warnings for virtual functions. My code compiles without any warnings but the editor shows the relevant lines as a syntax error.

I have set the compiler's dialect to ISO C++ 1y and have rebuilt the Index. Whatever I try I cannot stop the editor from reporting syntax errors. Is this because Eclipse does not yet fully support the C++17 standard? If this is the case, is it worth me waiting for this to be supported or (if it's going to be a long time) should I refactor to use a more conventional way to to silence unused parameter warnings?

Many Thanks
Amanda

[Updated on: Mon, 29 January 2018 19:14]

Report message to a moderator

Re: [[maybe_unused]] C++17 [message #1831856 is a reply to message #1780878] Tue, 01 September 2020 07:52 Go to previous messageGo to next message
Rajdeep Thakare is currently offline Rajdeep ThakareFriend
Messages: 2
Registered: September 2020
Junior Member
Hello, did you got the solution??
Re: [[maybe_unused]] C++17 [message #1831938 is a reply to message #1831856] Thu, 03 September 2020 11:01 Go to previous message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
Set the dialact to C++17 of C++20, Eclipse/CDT 2020-06 (4.16.0) / 9.11

Cheers,

Joost
Previous Topic:Eclipse CDT C++ throwing Syntax Error
Next Topic:CDT indexing problems: out of memory, waiting for exclusive lock and type hierarchy
Goto Forum:
  


Current Time: Tue Oct 08 00:09:40 GMT 2024

Powered by FUDForum. Page generated in 0.04720 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top