Skip to content

Commit

Permalink
[Clang] Fix building with Clang < 3.9.
Browse files Browse the repository at this point in the history
This is a workaround for a bug in older versions of Clang when. The
constructor that is supposed to allow for Derived to Base conversion
does not work. Remove this if we drop support for such configurations.
  • Loading branch information
Bigcheese committed Jul 17, 2020
1 parent 7738c03 commit fda901a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions llvm/utils/TableGen/OptParserEmitter.cpp
Expand Up @@ -110,7 +110,11 @@ class MarshallingFlagInfo final : public MarshallingKindInfo {
static std::unique_ptr<MarshallingKindInfo> create(const Record &R) {
std::unique_ptr<MarshallingFlagInfo> Ret(new MarshallingFlagInfo(R));
Ret->IsPositive = R.getValueAsBit("IsPositive");
return Ret;
// FIXME: This is a workaround for a bug in older versions of libstdc++ when
// compiled with Clang. The constructor that is supposed to allow for
// Derived to Base conversion does not work. Remove this if we drop
// support for such configurations.
return std::unique_ptr<MarshallingKindInfo>(Ret.release());
}

private:
Expand Down Expand Up @@ -204,7 +208,11 @@ struct SimpleEnumValueTable {
"values");
}

return Ret;
// FIXME: This is a workaround for a bug in older versions of libstdc++ when
// compiled with Clang. The constructor that is supposed to allow for
// Derived to Base conversion does not work. Remove this if we drop
// support for such configurations.
return std::unique_ptr<MarshallingKindInfo>(Ret.release());
}

private:
Expand Down

0 comments on commit fda901a

Please sign in to comment.