Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mmatrosov opened this issue Oct 19, 2016 · 10 comments

Comments

@mmatrosov
Copy link

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
Copy link
Owner

Which VS and boost version?

@mmatrosov
Copy link
Author

Visual Studio 2015 Update 4. boost 1.58.

@KindDragon
Copy link
Owner

KindDragon commented Oct 19, 2016

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
Copy link
Owner

Same issue with std::atomic

@mmatrosov
Copy link
Author

Is it reported anywhere?

@KindDragon
Copy link
Owner

IDK

@mmatrosov
Copy link
Author

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

@KindDragon
Copy link
Owner

@mmatrosov
Copy link
Author

Thanks!

@KindDragon
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants