Intellisense may be Incorrectly flagging errors

Sysprogs forums Forums VisualGDB Intellisense may be Incorrectly flagging errors

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33698
    GeneM
    Participant

    A couple of lines in one of the files in my program are underscored with a red squiggly line indicating there’s an error. When I hover over the underscored text, I can see what Intellisense thinks the error is as shown in the attached screen shot.  It doesn’t look like an error to me according to my understanding of std::string_view and the program compiles and runs just fine.  Do I have something setup incorrectly?

    Thanks

    • This topic was modified 1 year, 3 months ago by GeneM.
    Attachments:
    You must be logged in to view attached files.
    #33704
    support
    Keymaster

    Hi,

    This typically happens for complex projects using custom toolchains – some of the implicit macros set by the compiler do not get properly passed to the VisualGDB’s IntelliSense engine, and prevent IntelliSense from finding the relevant function definitions in the headers.

    In order to track it down, please follow the steps below:

    1. Isolate the problem to a minimal project with just one source file, one function (e.g. void test123() {…}) and as little #include<> directives as possible.
    2. Manually the actual definition of the missing method by searching the header files.
    3. Try opening that header file in Visual Studio and see if the relevant definition is grayed out. If it is, check for conditional statement (#if <…>) that could be blocking it.
    4. If you have found the relevant conditional statement (e.g. #ifdef SOME_FEATURE), you can manually pass it to the IntelliSense engine via VisualGDB Project Properties -> IntelliSense Settings -> Additional CFLAGS (the flag in this example would be -DSOME_FEATURE or -DSOME_FEATURE=123).
    5. If the statement is not grayed out, try moving the test() function directly in the header file, as close to the definition as possible. If it works from there, some code after the definition is interfering with IntelliSense. Moving the test123() function to different parts of the header file (or further down the #include<> stack) should help isolate the part causing the problem.
    #33707
    GeneM
    Participant

    Thanks for the clues, this is almost for sure related to the fact this is a CMake project set up by somebody else.  I did build a really simple MSBuild project in VGDB with the same code shown in that snip I attached.  It worked just fine with no red error underscores.  I think we’re good for now.  Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.