C++11 Intellisense in Visual Studio 2015

Sysprogs forums Forums VisualGDB C++11 Intellisense in Visual Studio 2015

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #7117
    MartinBonner
    Participant

    I want Intellisense to understand things like std::unique_ptr and std::move.  I have enabled -std=c++11 in CXXFLAGS.

    If I open <utilty> I see:

    #if __cplusplus >= 201103L
     #include <bits/move.h>
     #include <initializer_list>

     

    The #includes are greyed out, and hovering over “__cplusplus” says it is #defined to 199711L

     

    Following the earlier thread about C++11 Intellisense, I can see that Project Properties has $(ProjectDir)\gcc_Debug_ARM.h in the “Force Includes” section, and that gcc_Debug_ARM.h contains:

    //VS2005-2012 treats all files as C++, while VS2013+ can treat C files correctly.
    #if defined(_MSC_VER) && (_MSC_VER < 1800 || defined(__cplusplus))
    #define __cplusplus 201103L
    #endif

    Hovering over _MSC_VER shows it #defined to 1900.

    Why doesn’t Intellisense recognize all the C++11 features?

     

    Finally, Help About Info from VS2015 shows:

    Microsoft Visual Studio Professional 2015
    Version 14.0.23107.0 D14REL
    Microsoft .NET Framework
    Version 4.6.00081

    Installed Version: Professional

    LightSwitch for Visual Studio 2015 00322-40000-00000-AA452
    Microsoft LightSwitch for Visual Studio 2015

    Visual Basic 2015 00322-40000-00000-AA452
    Microsoft Visual Basic 2015

    Visual C# 2015 00322-40000-00000-AA452
    Microsoft Visual C# 2015

    Visual C++ 2015 00322-40000-00000-AA452
    Microsoft Visual C++ 2015

    ASP.NET and Web Tools 14.0.20626.0
    ASP.NET and Web Tools

    ASP.NET Web Frameworks and Tools 2013 5.2.30624.0
    For additional information, visit http://www.asp.net/

    Atomineer Pro Documentation 1.0
    Source-code documentation-comment creation and maintenance, and other documentation-related tools.

    Common Azure Tools 1.5
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

    Deleaker for Visual Studio 3.0.73.0
    Deleaker detects leaks, shows allocated memory, GDI objects, handles and other objects.

    Extensibility Tools 1.5.103
    An extension for making it easier to write Visual Studio extensions

    GenerateUnitTest 1.0
    Generates unit test code for methods in classes under test.

    Microsoft Azure Mobile Services Tools 1.4
    Microsoft Azure Mobile Services Tools

    Microsoft MI-Based Debugger 1.0
    Provides support for connecting Visual Studio to MI compatible debuggers

    NuGet Package Manager 3.2.0
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    Office Developer Tools for Visual Studio 2015 ENU 14.0.23025
    Microsoft Office Developer Tools for Visual Studio 2015 ENU

    PreEmptive Analytics Visualizer 1.2
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

    Python Tools for Visual Studio 2.2.30718.00
    Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

    Python Tools for Visual Studio – Django Integration 2.2.30718.00
    Provides templates and integration for the Django web framework.

    Python Tools for Visual Studio – Profiling Support 2.2.30718.00
    Profiling support for Python projects.

    Trailing Whitespace Visualizer 1.0
    Makes it easier than ever to identify and remove trailing whitespace in any code file

    Visual C++ for Cross Platform Mobile Development 1.0
    Visual C++ for Cross Platform Mobile Development

    Visual C++ for Cross Platform Mobile Development 1.0
    Visual C++ for Cross Platform Mobile Development

    Visual Studio Tools for Universal Windows Apps 14.0.23309.00 d14oob
    The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

    VisualGDB 5.0
    Allows developing and debugging Embedded, Linux, Android and other GCC/GDB-based applications with Visual Studio.

    VS10x CodeMAP Package 1.1
    Powerful Visual Studio code editor visualizer (C#, VB, C++).

    VS10x Method Block Highlighter Package 1.2
    Highlight entire methods with a colored background (green, yellow, cyan, magenta)

    Workflow Manager Tools 1.0 1.0
    This package contains the necessary Visual Studio integration components for Workflow Manager.

     

    #7119
    MartinBonner
    Participant

    Woo hoo!  Found a workround:  Go to “IntelliSense Settings” tab on the VisualGDB Project Properties, and change IntelliSense engine to “Enable advance Clang-base IntelliSense engine”.

    (Of course, this does mean you have to go round fixing all the undefined behaviour that Clang doesn’t like in your code!)

    #7123
    MartinBonner
    Participant

    Hmm.  That workround only seems to work sometimes 🙁

    Anyone have any better solutions?

    #7128
    support
    Keymaster

    Hi,

    Yes, we have created the Clang-based IntelliSense because the VS IntelliSense does not work well with many GCC-specific extensions including the C++11 ones.

    You can also enable the Clang IntelliSense globally via Tools->Options->VisualGDB. Please provide us an example of the code formatting problem in the other thread so that we could release a hotfix or suggest a workaround.

    #7141
    ivas
    Participant

    I’ve resolved this problem by adding “#undef __cplusplus” before “#define __cplusplus 201103L” in gcc_Debug.h and gcc_Release.h:

    #if defined(_MSC_VER) && (_MSC_VER < 1800 || defined(__cplusplus))
    #undef __cplusplus
    #define __cplusplus 201103L
    #endif

    But every time when project’s settings is changed, VisualGDB restores these files.

    #7158
    support
    Keymaster

    Hi,

    As a workaround you can edit the Makefile settings by editing debug.mak and release.mak directly.

    As VS IntelliSense often stops parsing the files silently when it encounters some extension that it does not support and those problems are very hard to diagnose, we recommend using the Clang engine instead.

    #7162
    MartinBonner
    Participant

    Sorry, I don’t understand your workround Bazis.  What changes do I need to make to debug.mak/release.mak?

    Notes:

    1. The workround that ivas suggests seems to work completely.
    2. The Clang engine is completely unacceptable until the formatting problem is fixed (see other thread).  (I’d rather just switch off Intellisense entirely.)
    #7168
    support
    Keymaster

    Hi,

    VisualGDB rewrites the gcc_Debug.h file when you change some settings (e.g. include directories) in VisualGDB GUI. You can skip this process by changing the include directories/preprocessor macros directly in the debug.mak file.

    We are sorry that the Clang engine is causing you troubles. The behavior you are encountering is definitely not by design and it looks like either a conflict between VisualGDB and some other plugin or a bug caused by some rare configuration setting. I have attached a link to a diagonstic build to the other thread, please give it a try and let me know the output it provides. This should help us pinpoint the problem.

    #7448
    marrtin
    Participant

    It would be very useful to fix this problem. Clang intellisense often crash in my project, so I am using native intellisense.

    Although the codemaps when Clang is used are great :(.

    Is there really no another possibility to define #define __cplusplus 201103L in gcc_Debug.h correctly?

    Now I have to use iva’s solution with undef, but I have to do it everytime, when I change something in VisualGDB settings.

    Of course it’s confusing.

    #7449
    MartinBonner
    Participant

    Clang intellisense is (I believe) the preferred solution.  If Clang intellisense is crashing in your project, I am pretty sure Sysprogs would like to know about it – raise a separate issue for it though.  (I do have a formatting problem with Clang Intellisense, for which they have send me a test fix – but I haven’t tried it yet.  I must.)

    #7451
    marrtin
    Participant

    Thanks for your comment.

    I noticed that Clang intellisense looks very nice for me. And there aren’t such problems with c++11.

    But it is also disturbing often to see dialog CppEngineHost has stopped working. It didn’t cause the crash of Visual studio but my trust to this intellisense  engine is at that moment less :).

    #7460
    support
    Keymaster

    Hi,

    Yes, we specifically designed the Clang engine to run in a separate process so that any crashes inside clang don’t affect your Visual Studio.

    Are you able to reliably reproduce some of the crashes and send us the repro instructions? If it only happens with your project, we can send you a debug build of the engine so that you could create a dump file.

    We have easily fixed previous crashes like that, so your crash dumps are more than welcome.

    #8723
    Rumchiller
    Participant

    Hi,

    I have the same problem with my project. I have to put the #undef in the gccdebug.h file. Without it I get a bunch of errors. Is there a workaround?

    It seems, that the Clang Engine is not running, here is the output:

    [+0:00:00.000] Starting operation: Wrapping C:\Users\Werkstatt\Desktop\Wuchtmaschine\ERB_FW_SPL_DP\ERB_FW_SPL_DP\ERB_FW_SPL_DP.vcxproj
    [+0:00:00.039] C:\Users\Werkstatt\Desktop\Wuchtmaschine\ERB_FW_SPL_DP\ERB_FW_SPL_DP\ERB_FW_SPL_DP.vcxproj: found 85 source files
    [+0:00:00.039] Operation completed: Wrapping C:\Users\Werkstatt\Desktop\Wuchtmaschine\ERB_FW_SPL_DP\ERB_FW_SPL_DP\ERB_FW_SPL_DP.vcxproj [37 msec]
    [+0:00:00.039] VSProjectWrapper: _Instance not set while trying to extract project compiler arguments
    [+0:00:00.039] Stack trace:
    [+0:00:00.039] bei k91.r1.t_2()
    [+0:00:00.039] bei uh1.BuildProfileForSupportedCppProject(Object c, String a, ICppLanguageService b)
    [+0:00:00.039] bei tu.f1(Project b, IVsHierarchy c, List`1 a)

     

    Thanks in advice.

    Greetings

    Reginald Leonczuk

    • This reply was modified 8 years, 3 months ago by Rumchiller.
    #8725
    support
    Keymaster

    This is a known bug. Please try this build and let us know if the problem still reoccurs: http://sysprogs.com/files/tmp/VisualGDB-5.2.5.954.msi

    #8728
    Rumchiller
    Participant

    Thanks, I will try this build next week.

    Oddly enough, Clang started working today.

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