[SERVER-14035] Introduce MONGO_NOEXCEPT macro for labeling methods that mustn't throw. Created: 22/May/14  Updated: 10/Dec/14  Resolved: 04/Jun/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Won't Fix Votes: 0
Labels: c++11
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

The C++11 implementation will be noexcept and the legacy implementation will be throw (). For purposes currently of interest in the mongodb codebase, these have the same effect of having terminate() called at runtime if an exception bubbles out of them.



 Comments   
Comment by Andy Schwerin [ 04/Jun/14 ]

MSVC does not support noexcept or throw(), so this cannot be implemented for all supported compilers at present.

Comment by Githook User [ 04/Jun/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: Revert "SERVER-14035 Introduce MONGO_NOEXCEPT macros in mongo/platform/compiler.h."

This reverts commit 6fea6df0f8065bfa28fa17f94a5150482ed780da, because MSVC cannot
provide this functionality.
Branch: master
https://github.com/mongodb/mongo/commit/331046290f4eac18df209d90d772734b3bbd8e5c

Comment by Andy Schwerin [ 03/Jun/14 ]

MONGO_NOEXCEPT's definition under MSVC was incorrect, because MSVC does not support standard behaviors for throw () or noexcept. See http://msdn.microsoft.com/en-us/library/wfa0edys.aspx for details.

Comment by Githook User [ 27/May/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-14035 Introduce MONGO_NOEXCEPT macros in mongo/platform/compiler.h.

These macros expand to "noexcept" in C+11 and "throw ()" in earlier C+
compilers, so we can label methods that should terminate() rather than
allow an exception to escape.
Branch: master
https://github.com/mongodb/mongo/commit/6fea6df0f8065bfa28fa17f94a5150482ed780da

Generated at Thu Feb 08 03:33:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.