aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2016-11-07 12:02:55 +1100
committerNeil <nyamatongwe@gmail.com>2016-11-07 12:02:55 +1100
commit76f0b9d9651c348fb8bc0c3280616ec63ba58808 (patch)
treef2cf6caf908a0ed02801541a8588edcfad46ed97
parent9bf7657055ac7868b15b1c9d59ecdb3cb52fbd1d (diff)
downloadscintilla-mirror-76f0b9d9651c348fb8bc0c3280616ec63ba58808.tar.gz
Specify 'noexcept' to use Clang with GNU <regex>.
Since 'noexcept' is not available with all compilers, restrict it to cases where needed.
-rw-r--r--src/Document.cxx12
1 files changed, 10 insertions, 2 deletions
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 <vector>
#include <algorithm>
+#define NOEXCEPT
+
#ifndef NO_CXX11_REGEX
#include <regex>
+#if defined(__GLIBCXX__)
+// If using the GNU implementation of <regex> 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<std::bidirectional_iterator_tag, wchar
public:
UTF8Iterator(const Document *doc_=0, Position position_=0) : doc(doc_), position(position_) {
}
- UTF8Iterator(const UTF8Iterator &other) {
+ UTF8Iterator(const UTF8Iterator &other) NOEXCEPT {
doc = other.doc;
position = other.position;
}