[Clang] Fix building with Clang < 3.9.
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.
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
index 251533a..34699b5 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptParserEmitter.cpp
@@ -110,7 +110,11 @@
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:
@@ -204,7 +208,11 @@
"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: