From 76f0b9d9651c348fb8bc0c3280616ec63ba58808 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 7 Nov 2016 12:02:55 +1100 Subject: Specify 'noexcept' to use Clang with GNU . Since 'noexcept' is not available with all compilers, restrict it to cases where needed. --- src/Document.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index 58f663376..c105bdda3 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -16,8 +16,16 @@ #include #include +#define NOEXCEPT + #ifndef NO_CXX11_REGEX #include +#if defined(__GLIBCXX__) +// If using the GNU implementation of then have 'noexcept' so can use +// when defining regex iterators to keep Clang analyze happy. +#undef NOEXCEPT +#define NOEXCEPT noexcept +#endif #endif #include "Platform.h" @@ -2570,7 +2578,7 @@ public: Position position; ByteIterator(const Document *doc_ = 0, Position position_ = 0) : doc(doc_), position(position_) { } - ByteIterator(const ByteIterator &other) { + ByteIterator(const ByteIterator &other) NOEXCEPT { doc = other.doc; position = other.position; } @@ -2745,7 +2753,7 @@ class UTF8Iterator : public std::iterator