Derive a class from std::basic_streambuf that has a destructor with no exception-specifier. It will not compile when the /Za flag (disable Microsoft extensions) is used. This causes boost::format to fail to compile with /Za. When one gets that compiler error, it is not easy to track down the cause.
Both C++03 and C++11 specify that the virtual destructor for std::basic_streambuf shall have no exception-specifier (C++03, Section 27.5.1 - C++11, Section 27.6.3). Exception-specifiers are deprecated, and should be removed in any case. The standards also require that any override of a virtual function, including virtual destructors, shall not indicate exception-exclusion that is weaker than the exception-specifier on the base class's member function.
"If a virtual function has an exception-specification, all declarations, including the definition, of any function that overrides that virtual function in any derived class shall only allow exceptions that are allowed by the exception-specification of the base class virtual function." (C++03 §15.4/3)
1. /Za in this case does not disable an "extension"; It enables one, and a dangerous one at that. The behavior with /Za is the behavior that is mandated by the C++ standards.
2. The spurious "throw()" exception-specifier in the VC++ header file assures that any class that derives from std::basic_streambuf must use a deprecated feature in order to be correct. Even if it does not define an override for the destructor, the compiler must provide one with a "throw()" specifier. (I have not checked to see if VC++ does so.)
Action indicated - (must be done in this order)
1. Remove exception-specifiers from all header files. They are deprecated, and if used incorrectly, as in the case of std::basic_streambuf, cause conforming programs to fail to compile when the /Za flag is present. Do not replace throw() with noexcept in standard interfaces unless the C++ standard says to.
2. Make the compiler conform with C++03 §15.4/3 regardless of the /Za flag. The standard-conforming behavior is not an "extension." It is necessary.