Bug 578677 - C++ indexer failure with Boost and C++17
Summary: C++ indexer failure with Boost and C++17
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 10.5.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: cxx17
  Show dependency tree
 
Reported: 2022-02-10 09:00 EST by Yoann Le Montagner CLA
Modified: 2022-04-19 14:29 EDT (History)
3 users (show)

See Also:


Attachments
Reproducer sources + screenshot (132.91 KB, application/zip)
2022-02-10 09:00 EST, Yoann Le Montagner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yoann Le Montagner CLA 2022-02-10 09:00:48 EST
Created attachment 288024 [details]
Reproducer sources + screenshot

The C++ index fails to resolve some symbols in a project containing the 3 files:
- wrapper_main.cpp
- wrapper.cpp
- wrapper.h
(see the attached zip file and the embedded screenshot)

It was hard to isolate a minimal reproducer, and it seems that all the remaining elements in the project matter. In particular:
- I don't have any problem if file `wrapper_main.cpp` is named differently,
- I don't have any problem if files `wrapper.{h,cpp}` are removed and `#include "wrapper.h"` is also removed in `wrapper_main.cpp`,
- I don't have any problem if all the boost stuff is removed from `wrapper_main.cpp`, keeping only:
```
#include <optional>
void my_fun_with_optional() {
	std::optional<int> n = std::make_optional(42);
}
```

Full workflow for project creation:
1) File > New > C/C++ project
2) Select C++ Managed build
3) Give a name + select Project type = Executable/Empty project with toolchain Linux GCC
4) Finish
5) In project properties > C/C++ Build > Settings > Tool settings > GCC C++ Compiler/Dialect, select Language standard = ISO C++17
6) Apply and close
7) Import the 3 source files mentioned above at project root.
8) Rebuild indexer if necessary
9) => Errors shown in file `wrapper_main.cpp`.
Comment 1 Yoann Le Montagner CLA 2022-02-10 09:02:37 EST
PS:
- CDT version is 10.5
- Eclipse version is 2021-12
- GCC version is 9.3.0
- Boost version is 1.77
Comment 2 Jonah Graham CLA 2022-04-19 14:29:33 EDT
Hi Yoann,

At the moment the C++17 support in CDT is incomplete. Please see Bug 490406 and dependent bugs.