Community
Participate
Working Groups
Created attachment 287181 [details] Cmake and Managed build projects of the same code Using the attached two C projects (one CMake, one Managed build) I get different results from the indexer. I'm using the spdlog project for logging at version 1.9.2 and have copied the include directory into each project. The code is the same in both projects: #include "spdlog/spdlog.h" int main() { spdlog::default_logger_raw()->debug("Message {}", 5); } And in the Managed project it successfully indexes it as: template<typename... Args> void debug(fmt::format_string<Args...> fmt, Args &&...args) { log(level::debug, fmt, std::forward<Args>(args)...); } but on the CMake project I get the error: Invalid arguments ' Candidates are: void debug(fmt::v8::basic_format_string<char,fmt::v8::type_identity<#0(...)>::type ...>, #0(...) && ...) void debug(const #0 &) '
@Martin does this example sound like it is in your area of knowledge? Thanks! @Philip thank you for the report.
´Invalid arguments ' Candidates are: void ...´ Looks like a GCC error message to me. o.e.cdt.jsoncdb just passes macros and include paths to the indexer. Maybe these differ between MBS build and CMake build. You can see the macros and includes if you open a source-file in the editor, then select menu Project | C/C++ Index | Create parser Log file. (No idea why this is not in the editor context menu.)
@Jonah @Nartin Thanks both for your help. I built the parser log files for the two projects as you suggested, and noticed a key difference up front. In the CMake Project: Include Search Path (option -I): /opt/rh/devtoolset-8/root/usr/include/c++/8 /opt/rh/devtoolset-8/root/usr/include/c++/8/x86_64-redhat-linux /opt/rh/devtoolset-8/root/usr/include/c++/8/backward /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/include /usr/local/include /opt/rh/devtoolset-8/root/usr/include /usr/include And in the Managed Build Project: /usr/include/c++/4.8.2 /usr/include/c++/4.8.2/x86_64-redhat-linux /usr/include/c++/4.8.2/backward /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include /usr/local/include /usr/include So I span up a new Managed Build project which uses the devtoolset-8 g++ compiler (using the 'Linux GCC' toolchain rather than the 'Cross GCC' default) and that new project also cannot index that function call. So perhaps its because of the g++ 8.3.1 compiler? I've attached the Parser log for the CMake Project to see if you can make anything of it. Thanks, Phil
Created attachment 287185 [details] Indexer Parser Log for CMake Project
@Philip These are two different compilers: One is GCC 8 and the other one is GCC 4.8.2. This bug is definitely NOT related to the indexer.
Hi Martin, Is this not just an indexer issue when using GCC 8? I've discovered that if I modify the code to: spdlog::default_logger_raw()->debug(fmt::v8::basic_format_string<char>("Message {}"), 5); i.e. tell the compiler/indexer up-front to convert the literal string to a basic_format_string, then the indexer is able to find the correct function. Thanks, Phil
@Philip Sorry, when I said the bug is NOT related to the indexer, I assumed the error message was in the build-output console. Actually, I cannot tell whether it is a bug in the indexer due to my lack of knowlege of the indexer code.