I had a similar problem using Eclipse C++ 2019-03 for a mixed C and C++ project that used std::optional
and std::swap
. What worked for me was this.
In the project
Properties->C/C++ Build->Settings->Tool Settings->Cross G++ Compiler
, remove -std=gnu++17
from Miscellaneous
and put it in Dialect->Other Dialect Flags
instead.