How to view template compiler error details in Vis

2019-05-18 00:49发布

问题:

I am working with Visual Studio 2015 and I'm getting a lot of compiler errors but I can't figure out where the root cause of those is:

Double-clicking on the highlighted error takes me into the list file to the operator==:

template<class _Ty,
class _Alloc> inline
bool operator==(const list<_Ty, _Alloc>& _Left,
    const list<_Ty, _Alloc>& _Right)
{   // test for list equality
return (_Left.size() == _Right.size()
    && _STD equal(_Left.begin(), _Left.end(), _Right.begin()));
}

Well, that doesn't help. Since I am working on a huge project, I don't know where the root cause of that error is, i.e. where is the code which uses the std::list in a way that causes this error?

I think XCode shows a stack for such errors, if I remember correctly.
How can I find out where this error originates?

回答1:

As discussed in the comments, the Output tab (Ctrl+Alt+O) shows all the messages from the compiler. The Error List tab just shows one message, the actual error, which, as you said, for template compilation problems is not very helpful. What I have found works rather well (it is a little tedious, but it does work), is to

  1. Double click on the message in the Error List tab.
  2. Switch to the Output tab
  3. Step to next message in the chain using F8 (shift-F8 steps to previous message)