0

On MacOSX Yosemite with clang I am unable to compile the file which contains the following method in the header (updaterplugin.h:47):

void update() throw(std::runtime_error) final override;

Clang says:

-o moc_updaterplugin.cpp updaterplugin.h:47: Parse error at ")"

When I remove the throw(std::runtime_error) statement it compiles successfully.

Also interesting fact that this behavior depends on Qt somehow because plain C++11 code compiles successfully and errors like these usually come from Qt's MOC-classes.

Is there any fix for this?

VP.
  • 15,509
  • 17
  • 91
  • 161

1 Answers1

2

It seems that exception specifications are deprecated in C++11 (but the noexcept specifier is significant).

So just remove the throw(std::runtime_error)

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547