summaryrefslogtreecommitdiff
path: root/src/sexpr/variant.tcc
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-08-05 20:16:29 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-08-05 20:16:29 -0700
commit7ec146c05489f43dddb1b7af948a193c1cf0a9d1 (patch)
tree00d96dfb5723168550ee9ad2ec4a1797cd7a75ce /src/sexpr/variant.tcc
parenta7f64f0b39cb7141f16608c171b20bee452fd024 (diff)
downloadtmwa-7ec146c05489f43dddb1b7af948a193c1cf0a9d1.tar.gz
tmwa-7ec146c05489f43dddb1b7af948a193c1cf0a9d1.tar.bz2
tmwa-7ec146c05489f43dddb1b7af948a193c1cf0a9d1.tar.xz
tmwa-7ec146c05489f43dddb1b7af948a193c1cf0a9d1.zip
Work around a compiler bug in error checks
Diffstat (limited to 'src/sexpr/variant.tcc')
-rw-r--r--src/sexpr/variant.tcc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sexpr/variant.tcc b/src/sexpr/variant.tcc
index ce820bf..69bf191 100644
--- a/src/sexpr/variant.tcc
+++ b/src/sexpr/variant.tcc
@@ -20,6 +20,8 @@
#include <cassert>
#include "bind.hpp"
+#include "../diagnostics.hpp"
+
namespace tmwa
{
namespace sexpr
@@ -116,9 +118,11 @@ namespace sexpr
data.template construct<C, A...>(std::forward<A>(a)...);
state = not_negative_one<Union<D, T...>::template index<C>()>();
}
- catch(...)
+ catch (...)
{
+#if GCC_PATCH != 40702 // apparent compiler bug, not reduced
static_assert(std::is_nothrow_constructible<D>::value, "first element is nothrow constructible");
+#endif
data.template construct<D>();
state = 0;
throw;