-std=c++17 makes things worse instead of fixing them [message #1814908] |
Sun, 22 September 2019 14:35 |
Alain Mosnier Messages: 1 Registered: September 2019 |
Junior Member |
|
|
Hi,
I am using a "Makefile project in a directory containing existing code".
I ensure that the build command emits all g++ invocations in the console window, which I believe is necessary for the "CDT GCC Build Output Parser" mechanism to work properly.
It mostly works perfectly, including indexing.
I have gone though a few of the steps at vulkan-tutorial.com/.
When coming to step 5, vulkan-tutorial.com/code/05_window_surface.cpp, the indexing starts to partly fail: "Type 'std::optional<uint32_t>' could not be resolved".
When I get such an issue, I usually go to Project - Properties - Preprocessor Include Paths, Macros etc. - CDT GCC Built-in Compiler Settings and add "-std=c++17" (or whatever is applicable). When I do that now (${COMMAND} ${FLAGS} -std=c++17 -E -P -v -dD "${INPUTS}") and rebuild the index, instead of the problem being solved, the number of unresolved symbols just increases. The additional unresolved symbols have typically nothing to do with modern C++.
What I think is even weirder is that if I apply the same procedure to a minimal project that uses std::optional, that just works! I can also see that the __cplusplus symbol has the expected value in all cases (201703L when it should, 201402L otherwise), whether indexing works or not.
It looks like there is some kind of combination that breaks things. I have tried removing and adding code, and it seems that the combination std::set and std::optional is somehow involved.
How would I go about if I want to understand more about where the indexing goes wrong?
Also, is it possible the see what values ${COMMAND} and ${FLAGS} have?
Please note that in all cases above, the code builds and run without problem.
Thanks in advance.
Alain
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26583 seconds