std::mutex not a constexpr with /MTd compiler flag - by Inge Eivind Henriksen

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


3
0
Sign in
to vote
ID 776596 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 1/15/2013 6:46:44 AM
Access Restriction Public

Description

Example hangs if compiled with the /MTd (Multi-threaded Debug) compiler flag, but works fine if compiled with the /MDd (Multi-threaded Debug DLL) compiler flag. std::mutex implementations are supposed to be constexpr's, thus no calls to delete() or new() should take place.
Sign in to post a comment.
Posted by Artur [MSFT] on 1/20/2014 at 10:08 AM
Hi Inge,

I wanted to let you know the status of this issue.
There are several things going on here. First, the constructor of std::mutex allocates memory on the heap, which makes it non-noexcept. I fixed this in our internal tree, and the fix will show up in the next release of the VS. The other problem here is related to static linking and user-defined operators new/delete. This isn't fixed yet, but we have plans to address this in the future.

Thanks for reporting this to us,
Artur Laksberg
VC++ Libraries team.
Posted by Artur [MSFT] on 1/20/2014 at 10:03 AM
Hi Inge,

I wanted to let you know the status of this issue.
There are several things going on here. First, the constructor of std::mutex allocates memory on the heap, which makes it non-noexcept. I fixed this in our internal tree, and the fix will show up in the next release of the VS. The other problem here is related to static linking and user-defined operators new/delete. This isn't fixed yet, but we have plans to address this in the future.

Thanks for reporting this to us,
Artur Laksberg
VC++ Libraries team.
Posted by Stephan [MSFT] on 2/21/2013 at 1:52 PM
Hi,

Thanks for reporting this bug. I wanted to let you know what's happening with it. I'm still keeping track of it, but it's been resolved as "Deferred" because we may not have time to fix it in VC12. (Note: VC8 = VS 2005, VC9 = VS 2008, VC10 = VS 2010, VC11 = VS 2012.)

Note: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
Posted by Macy [MSFT] on 1/15/2013 at 9:37 PM
Thanks for your feedback.

We are rerouting 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 Inge Eivind Henriksen on 1/15/2013 at 9:09 AM
The same error also occurrs when applying the /MT compiler flag, but it works correct with /MD .
Posted by Macy [MSFT] on 1/15/2013 at 6:51 AM
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)