From 7ec146c05489f43dddb1b7af948a193c1cf0a9d1 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 5 Aug 2014 20:16:29 -0700 Subject: Work around a compiler bug in error checks --- src/diagnostics.hpp | 1 + src/sexpr/variant.tcc | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/diagnostics.hpp b/src/diagnostics.hpp index 31596dc..dab15b5 100644 --- a/src/diagnostics.hpp +++ b/src/diagnostics.hpp @@ -52,6 +52,7 @@ namespace tmwa # define CLANG (0) # endif #endif +#define GCC_PATCH (GCC * 100 + __GNUC_PATCHLEVEL__) #if GCC >= 406 || CLANG # define PRAGMA(x) _Pragma(#x) static_assert(1, "I like my semicolons") 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 #include "bind.hpp" +#include "../diagnostics.hpp" + namespace tmwa { namespace sexpr @@ -116,9 +118,11 @@ namespace sexpr data.template construct(std::forward(a)...); state = not_negative_one::template index()>(); } - catch(...) + catch (...) { +#if GCC_PATCH != 40702 // apparent compiler bug, not reduced static_assert(std::is_nothrow_constructible::value, "first element is nothrow constructible"); +#endif data.template construct(); state = 0; throw; -- cgit v1.2.3-60-g2f50