Skip to content

Commit 483c317

Browse files
committed
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.
1 parent 18da0b1 commit 483c317

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/util/type.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ class typet:public irept
3232

3333
explicit typet(const irep_idt &_id):irept(_id) { }
3434

35+
#if !defined(__GNUC__) || __GNUC__ >= 6
3536
typet(irep_idt _id, typet _subtype)
3637
: irept(std::move(_id), {}, {std::move(_subtype)})
3738
{
3839
}
40+
#else
41+
typet(irep_idt _id, typet _subtype)
42+
: irept(std::move(_id))
43+
{
44+
subtype() = std::move(_subtype);
45+
}
46+
#endif
3947

4048
const typet &subtype() const
4149
{

0 commit comments

Comments
 (0)