Commit e58852e9 authored by Sean McBride's avatar Sean McBride
Browse files

Suppress clang dynamic exception specifiers warning

Can't really remove the dynamic exception specifiers
and still be compatible with the superclass in C++98,
so just suppress the warning with a pragma.

Change-Id: I04ed166ad4111fd8e7401b6753f29749dde87f77
parent 5582d505
......@@ -12,6 +12,9 @@ class. We've made several VTK-specific modifications to support older compilers
* Altered utf16to8() to work with vtkstd::back_insert_iterator, which also reduces the
generality of the library.
* Suppress clang warnings about dynamic exception specifiers on a few methods. The methods need
to keep the "throw()" on their declaration to be compatible with their superclass in C++98.
For these reasons, we strongly discourage use of the VTK-specific version of UTF8-CPP, which is
a private part the VTK API, and subject to removal or revision at any time. See the following
links for the full version of the library:
......@@ -31,6 +31,17 @@ DEALINGS IN THE SOFTWARE.
#include "core.h"
#include <stdexcept>
// In C++11, clang will warn about using dynamic exception specifications
// as they are deprecated. But as this class is subclassing std::exception
// we must keep the 'throw()' to be C++98 compatible.
// So we suppress the warning.
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wdeprecated")
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated"
# endif
namespace vtk_utf8
// Exceptions that may be thrown from the library functions.
......@@ -313,6 +324,13 @@ namespace vtk_utf8
} // namespace vtk_utf8
// Undo warning suppression.
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wdeprecated")
# pragma clang diagnostic pop
# endif
#endif //header guard
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment