Community
Participate
Working Groups
Created attachment 287663 [details] ScreenShot Win10 mingw In the following simple programm ``` #include <utility> #include <iostream> using namespace std; int main() { int a=17, b=42; cout << "a=" << a << ", b=" << b << endl; swap(a, b); cout << "a=" << a << ", b=" << b << endl; } ``` the line with swap is marked with "invalid arguments" and a horrible error message. ``` Problem description: Invalid arguments ' Candidates are: std::enable_if::type swap(#0 &, #0 &) std::enable_if::type swap(std::pair &, std::pair &) std::enable_if:: type swap(#0 &, #0 &) std::enable_if::type swap(std::pair &, std::pair &) void swap(std::__cxx11::basic_string &, std::__cxx11::basic_string &) std::enable_if::type swap(#0 (&)[3 #1 0], #0 (&)[3 #1 0]) std::enable_if::type swap(#0 (&)[3 #1 0], #0 (&)[3 #1 0]) ' ``` However, it compiles fine with any compiler I know of and any version of C++ in this millenium. Apparently, the indexer fails to parse the (admittedly horrid) implementation in the respective header of the standard libary? This is on a clean install of eclipse 2021-12 on Windows 10 mit latest mingw, but also reproducible on linux (debian 11 + ubuntu 20.04). The project is a managed c++ project, no further configuration or options. Reindexing does not help.
I frequently encounter this issue too. An example: FilamentMonitor *fm = nullptr; std::swap(fm, filamentSensors[p_driver]); where FilamentMonitor is a declared class and filamentSensors is declared "static FilamentMonitor *filamentSensors[NumDrivers];". I am using gcc arm-none-eabi version 12.2 with option -std=gnu++17.
(In reply to David Crocker from comment #1) > I frequently encounter this issue too. An example: > > FilamentMonitor *fm = nullptr; > std::swap(fm, filamentSensors[p_driver]); > > where FilamentMonitor is a declared class and filamentSensors is declared > "static FilamentMonitor *filamentSensors[NumDrivers];". > > I am using gcc arm-none-eabi version 12.2 with option -std=gnu++17. You may have better luck trying the LSP integration mentioned at https://bugs.eclipse.org/bugs/show_bug.cgi?id=567764#c8 than waiting for this to be fixed
2024-03 cdt and manually installing cdt-lsp stable -> my bugs disappear (both under linux and windows). Hopefully, cdt-lsp will be the default for cdt soon anyway. can be closed with "won't fix" as far as I'm concerned.
Thank you for reporting back your good experience. The action plan is to include cdt-lsp in 2024-06 release and make it the default for new projects in CDT 12 as part of 2024-12 release. Closing as wontfix for the existing CDT indexer.