0

Has anyone noticed that when the C++ editor encounters >> brackets that close a template parameter list, the C++ editor code outliner stops working for all code beyond this line? The only solution that works so far is to put a space between the >> pair. Here's some code to cut and paste in. Can someone check it's also showing this odd behavior in their VS install too? Just wondering if it's specific to my installation + selection of extensions. I'm using VS 2012 with update 2:

  #pragma once
  #include "precompiled.h"
  #include "common.h"

  template<typename T>
  class ApplicationFrame : public CWindowImpl<ApplicationFrame<T>, CWindow, CWinTraits <WS_OVERLAPPEDWINDOW | WS_VISIBLE>> {

  public:

     ApplicationFrame() { }

     virtual ~ApplicationFrame() {

        if ( m_hWnd ) {
           DestroyWindow();
        }
     }
  };
Shafik Yaghmour
  • 154,301
  • 39
  • 440
  • 740
Darren Evans
  • 665
  • 10
  • 17
  • 1
    That *did* used to be a problem for compilers until C++11. – chris May 21 '13 at 22:04
  • @chris: I can't test this on VC11, but VC8 supported `>>` without space even before C++11. It would be quite interesting if they stopped supporting it now that it's Standard :D – Andy Prowl May 21 '13 at 22:06
  • 2
    @AndyProwl, Typical MSVS, refusing to adhere to the standard :p – chris May 21 '13 at 22:07
  • I know there were initial issues with >> in templates that the compiler struggled with and that the VS team allegedly fixed it in an update. I have no problems with compilation but it seems that the automatic outliner is still struggling. Is outlining done in the background with the help of the compiler? If so it appears more work needs to be done to prevent odd behavior :) – Darren Evans May 21 '13 at 22:11
  • @Seefer, As far as I know, Intellisense etc. doesn't run off of the compiler. Ever since the CTP came out, the Intellisense complains about all sorts of stuff the CTP accepts because it was meant to be a compiler update with the whole thing unfinished until who knows when. – chris May 21 '13 at 22:13
  • Got an error dialog pop up today that said an extension had caused an exception and to check **ActivityLog.xml**. I found an entry with a **System.ArgumentNullException: Value cannot be null** description and it appears to involve **Microsoft.VisualC.CppOutliner.GetTags**, hinting that the Intellisense code outlining problem when faced with >> in templates can cause VS instability when outlining is enabled. I'm new to C++ and only recently started using templated code heavily, so this is the first taste of Intellisense misbehaving. Up to now, everything's been relatively problem-free :) – Darren Evans May 22 '13 at 16:41

0 Answers0