Parenthesis in Compiler Out for "required from"

Sysprogs forums Forums VisualGDB Parenthesis in Compiler Out for "required from"

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25223
    aronrubin
    Participant

    As GCC emits errors or warnings about items in template instanciation it tries to report the lines that caused the instantiation. These are denoted with output lines of the form
    source_file_path.cpp:line:col: required from here
    or of the form
    source_file_path.h:line:col: required from 'class templated_class<tparams_from_instanciation>'
    It seems that you modify other output lines to match VC expectations (i.e. adding parenthesis). Could you do the same for the “required from” lines so I can double click on them?

    Thank you

    #25226
    support
    Keymaster

    Hi,

    Normally, VisualGDB should be already handling this automatically.

    Please try checking the BuildMessages/GCCOtherMessage element in [VisualGDB directory]\Rules\RegularExpressions.xml file. It contains a regex that is used to find the ‘required from here’ lines in the output.

    Please try applying this regex to the lines from your build log that don’t get mapped correctly to see why they are not matched and then try editing the regex to work around it (you may need to restart Visual Studio in order for the changes to take effect). Feel free to share the updated regex with us so that we will include it in our product builds.

     

    #25229
    aronrubin
    Participant

    The regex matches. Maybe GCCOtherMessage is not being used

    #25230
    aronrubin
    Participant

    Here I have added an error in a template to cause the message:

    [7/11] Building CXX object CMakeFiles/CxxSimulatorTest.dir/src/CxxSimulatorTest.cpp.obj
    FAILED: CMakeFiles/CxxSimulatorTest.dir/src/CxxSimulatorTest.cpp.obj 
    C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe   -I../../include -isystem _deps/googletest-src/googletest/include -isystem _deps/googletest-src/googletest -isystem _deps/googletest-src/googlemock/include -isystem _deps/googletest-src/googlemock -g   -std=gnu++17 -MD -MT CMakeFiles/CxxSimulatorTest.dir/src/CxxSimulatorTest.cpp.obj -MF CMakeFiles\CxxSimulatorTest.dir\src\CxxSimulatorTest.cpp.obj.d -o CMakeFiles/CxxSimulatorTest.dir/src/CxxSimulatorTest.cpp.obj -c ../../src/CxxSimulatorTest.cpp
    In file included from ../../src/CxxSimulatorTest.cpp:5:
    ../../include/CxxSimulator/Simulator.h: In member function 'void sim::Simulator::addModel()':
       61 |     abc();
          |     ^~~
    ../../include/CxxSimulator/Simulator.h: In instantiation of 'void sim::Simulator::addModel() [with ModelType = EmptyModel]':
    ../../src/CxxSimulatorTest.cpp:43:54:   required from here
    C:\Users\arubin\git\CxxSimulator\.\build\Debug\..\..\include\CxxSimulator\Simulator.h(61,8): error :  'abc' was not declared in this scope; did you mean 'abi'?
       61 |     abc();
          |     ~~~^~
          |     abi
    ../../include/CxxSimulator/Simulator.h: In instantiation of 'void sim::Simulator::addModel() [with ModelType = SimulationTest::LoopbackModel]':
    ../../src/CxxSimulatorTest.cpp:93:39:   required from here
       61 |     abc();
          |     ~~~^~
          |     abi
    ninja: build stopped: subcommand failed.
    

     

    #25231
    support
    Keymaster

    This might be something specific to a certain setup (e.g. Ninja/CMake or certain warning flags).

    Please try reproducing the problem on a freshly created MinGW-based “Hello, World” project and attach the project here. If we could reproduce the problem on our side, we should be able to fix it,  or suggest a workaround.

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