Search

system_error::what() returns incorrect value by chris_kohlhoff

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 642600
Opened: 2/10/2011 4:30:20 PM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
According to [syserr.syserr.members], the return value of system_error::what() should incorporate code().message(), but the implementation in VS2010 does not.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

 

Steps to reproduce

Compile and run the following program:

//------------------------------
#include <system_error>
#include <iostream>
#include <string>

int main()
{
std::error_code ec(1, std::generic_category());
std::system_error ex(ec);
std::cout << "Message: " << ex.code().message() << std::endl;
std::cout << "What: " << ex.what() << std::endl;
}
//------------------------------

cl /EHsc bug.cpp

Product Language

English

Operating System

Windows XP

Operating System Language

English

Actual results

When run, it outputs:

Message: Operation not permitted
What:

Expected results

It should output something like:

Message: Operation not permitted
What: Operation not permitted
File Attachments
0 attachments
Sign in to post a comment.
Posted by PowerGamer1 on 7/7/2012 at 11:07 AM
See for more details https://connect.microsoft.com/VisualStudio/feedback/details/752770/system-error-what-non-conformant-return-value
Posted by PowerGamer1 on 7/7/2012 at 9:53 AM
Still NOT fixed in Visual C++ 2012 RC. Is it going to be fixed in Visual C++ 2012 RTM?
Posted by Microsoft on 3/14/2011 at 5:06 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 2/10/2011 at 7:30 PM
Thanks for your feedback.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 2/10/2011 at 5:15 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.