KindDragon / CPPDebuggerVisualizers

C++ Debugger Visualizers
Boost Software License 1.0
174 stars 46 forks source link

Contents of boost::optional<T> are not displayed properly if T is declared in anonymous namespace #9

Open mmatrosov opened 8 years ago

mmatrosov commented 8 years ago

Consider this code:

namespace
{
  enum class Side { Right, Left };
}

enum class Dir { Up, Down };

int main() 
{
  auto side = Side::Right;  // Displayed ok
  boost::optional<Dir> dirOpt = Dir::Up;  // Displayed ok
  boost::optional<Side> sideOpt = Side::Right;  // Displayed raw only
}

Variables side and dirOpt are displayed fine. But variable sideOpt is displayed as there was no natvis installed - raw content is shown only.

KindDragon commented 8 years ago

Which VS and boost version?

mmatrosov commented 8 years ago

Visual Studio 2015 Update 4. boost 1.58.

KindDragon commented 8 years ago

Probably it is Visual Studio error:

Error while evaluating '*((enum `anonymous namespace'::Side *)dummy_.data)' in the context of type 'BoostTest.VS2015.exe!boost::optional_detail::aligned_storage<enum `anonymous namespace'::Side>'.

*((enum 'anonymous namespace'::Side*)0) this also doesn't work

KindDragon commented 8 years ago

Same issue with std::atomic

mmatrosov commented 8 years ago

Is it reported anywhere?

KindDragon commented 8 years ago

IDK

mmatrosov commented 8 years ago

Could you please either report it, or tell me how did you get this error message?

KindDragon commented 8 years ago

https://connect.microsoft.com/VisualStudio/feedback/details/3107485

mmatrosov commented 8 years ago

Thanks!

KindDragon commented 4 years ago

https://developercommunity.visualstudio.com/idea/388773/support-anonymous-namespaces-in-the-debugger.html