Skip to content

Commit e6ed708

Browse files
committed
Fix and add comment explaining differences in typename test
1 parent 28fcbe4 commit e6ed708

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/software/util/typename/typename_test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ class TestTypeA : public TestType
1717
TEST(TypeNameTest, abstract_base_class_concrete_subtype)
1818
{
1919
std::shared_ptr<TestType> test_type = std::make_shared<TestTypeA>();
20+
#ifdef __APPLE__
21+
// With clang / libc++, the standard library uses an inline namespace '__1' for
22+
// ABI versioning, which is reflected in the demangled type name.
23+
EXPECT_EQ("std::__1::shared_ptr<TestType>", objectTypeName(test_type));
24+
#else
2025
EXPECT_EQ("std::shared_ptr<TestType>", objectTypeName(test_type));
26+
#endif
2127
EXPECT_EQ("TestTypeA", objectTypeName(*test_type));
2228
}
2329

0 commit comments

Comments
 (0)