From ca155d3db2b8777eec518900649642dc3ecda03a Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 29 Mar 2019 22:11:30 +0000 Subject: [PATCH] Ensure typet constructor is always compatible with GCC 5's STL When enabling NAMED_SUB_IS_FORWARD_LIST, compilation failed as the std::forward_list constructors shipped with GCC 5 do not support an empty initializer list. GCC 6 and later do not have any such problem. --- src/util/type.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/type.h b/src/util/type.h index 4589fbe8eef..7f38fc5a335 100644 --- a/src/util/type.h +++ b/src/util/type.h @@ -32,10 +32,17 @@ class typet:public irept explicit typet(const irep_idt &_id):irept(_id) { } +#if defined(__clang__) || !defined(__GNUC__) || __GNUC__ >= 6 typet(irep_idt _id, typet _subtype) : irept(std::move(_id), {}, {std::move(_subtype)}) { } +#else + typet(irep_idt _id, typet _subtype) : irept(std::move(_id)) + { + subtype() = std::move(_subtype); + } +#endif const typet &subtype() const {