
Le 10/12/12 22:33, Christopher Kohlhoff a écrit :
Hi Vicente,
On Tue, Dec 11, 2012, at 01:27 AM, Vicente Botet wrote:
I don't know what the C++ standard says, but at least MSVC 10.0, gcc-4.7.2 and gcc-4.8.0 complain when I define a virtual function as noexept when the original declaration was not noexcept. This snippet illustrates what I mean:
class base { public: virtual const char* name() const = 0; };
class derived : public base { public: virtual const char* name() const noexcept; };
// ...
const char* derived::name() const noexcept { return ""; }
This compiles without error on gcc 4.7.2 (debian). Can you please confirm whether your experimental changes follow this form? This as well as the modification I checked on Windows-MinGW compiles well in MacOs for darwin-4.7.0x,darwin-4.6.2x,darwin-4.7.1x,clang-3.1xl,clang-3.2xl,darwin-latest_11,darwin-4.7.2x. on C++11 mode.
I will check your example tomorrow on MinGW. Could someone else check this simple example on MinGW with compiler supporting noexcept in C++11 mode? Vicente