[clang][dataflow] Add an operator<< for OptionalTypeIdentifier.

When tests fail in UncheckedOptionalAccessModelTest.cpp, this prints the name of the optional type instead of a blob of hex.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D155788
This commit is contained in:
Martin Braenne 2023-07-20 07:12:50 +00:00
parent 781beb3de5
commit 477ee05f83

View File

@ -1267,6 +1267,12 @@ struct OptionalTypeIdentifier {
std::string TypeName;
};
static raw_ostream &operator<<(raw_ostream &OS,
const OptionalTypeIdentifier &TypeId) {
OS << TypeId.NamespaceName << "::" << TypeId.TypeName;
return OS;
}
class UncheckedOptionalAccessTest
: public ::testing::TestWithParam<OptionalTypeIdentifier> {
protected: