Merge pull request #4460 from tautschnig/constructor-fix

Ensure typet constructor is always compatible with GCC 5's STL [blocks: #4458]
This commit is contained in:
Michael Tautschnig 2019-03-30 12:35:38 +00:00 committed by GitHub
commit d460249423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -32,10 +32,17 @@ public:
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
{