summaryrefslogtreecommitdiff
path: root/src/utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-05-05 07:57:37 +1000
committerMaxime Coste <mawww@kakoune.org>2018-05-05 07:57:37 +1000
commitda1d78a3c2f20de6b43c88839627573cec2fda17 (patch)
tree72a6a070a5805c9491550aba951b05bb0f1787b0 /src/utils.hh
parent7325ad216cbecb0d14fdee40cef7cca3e39f8513 (diff)
Do not let exception propagate out of register restoring lambda
It is called during a std::vector destruction, which is noexcept, leading to terminate being called.
Diffstat (limited to 'src/utils.hh')
-rw-r--r--src/utils.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils.hh b/src/utils.hh
index 23afdeb1..f21be9c1 100644
--- a/src/utils.hh
+++ b/src/utils.hh
@@ -73,7 +73,7 @@ public:
{ other.m_valid = false; }
[[gnu::always_inline]]
- ~OnScopeEnd() { if (m_valid) m_func(); }
+ ~OnScopeEnd() noexcept(noexcept(std::declval<T>()())) { if (m_valid) m_func(); }
private:
bool m_valid;