From 0278735ebe382f3588a02047f194c4b45b629250 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 9 May 2016 22:01:57 +0200 Subject: [PATCH] attempt to fix clang++ compilation error Seen on arch linux when clang++ 3.7.1 uses GCC's 6.1.1 tuple header. * spot/twaalgos/ltl2tgba_fm.cc (ratexp_to_dfa::succ): Build the return type explicitly. * NEWS: Mention the issue. --- NEWS | 4 ++++ spot/twaalgos/ltl2tgba_fm.cc | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 16530005b..3fe9fecfe 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,10 @@ New in spot 2.0.1a (not yet released) So "{:[i]s}".format(f) is the same as "{:s}".format(f.unabbreviate("i")). + Bug fixes: + + * Fix compilation error observed with Clang++ 3.7.1 and GCC 6.1.1 + headers. New in spot 2.0.1 (2016-05-09) diff --git a/spot/twaalgos/ltl2tgba_fm.cc b/spot/twaalgos/ltl2tgba_fm.cc index 05bb7a53b..0c006ec93 100644 --- a/spot/twaalgos/ltl2tgba_fm.cc +++ b/spot/twaalgos/ltl2tgba_fm.cc @@ -1047,14 +1047,22 @@ namespace spot else a = translate(f); + // Using return std::make_tuple(nullptr, nullptr, nullptr) works + // with GCC 6.1.1, but breaks with clang++ 3.7.1 when using the + // same header file for . So let's use the output type + // explicitly. + typedef std::tuple res_t; + // If a is null, f has an empty language. if (!a.first) - return std::forward_as_tuple(nullptr, nullptr, nullptr); + return res_t{nullptr, nullptr, nullptr}; auto namer = a.second; assert(namer->has_state(f)); auto st = a.first->state_from_number(namer->get_state(f)); - return std::forward_as_tuple(a.first, namer, st); + return res_t{a.first, namer, st}; } // The rewrite rules used here are adapted from Jean-Michel