================
@@ -61,5 +65,16 @@ TEST(EntityIdTest, Transitivity) {
   EXPECT_TRUE(Ids[0] < Ids[1] && Ids[1] < Ids[2]);
 }
 
+TEST(EntityIdTest, StreamOutput) {
+  EntityIdTable Table;
+  EntityName Entity("c:@F@foo", "", {});
+  EntityId Id = Table.getId(Entity);
+
+  std::string S;
+  llvm::raw_string_ostream(S) << Id;
+  EXPECT_THAT(S, StartsWith("EntityId("));
----------------
jkorous-apple wrote:

I am not brave enough to contradict such a request!
So, this is not an alternative, just FYI StringRef can refer to `std::string` 
and it also has some rudimentary comparison like `starts_with`, `ends_with`, 
and if things get desperate enough then also methods like `take_until`, 
`drop_while`.

https://github.com/llvm/llvm-project/pull/181765
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to