diff options
author | Chris Mihelich <cmihelic@google.com> | 2024-06-06 11:48:09 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-06-06 11:49:03 -0700 |
commit | 586a541d2bd9f66f7a7115338f3a2402ae5c46b6 (patch) | |
tree | 9496e868a4c6e6b4f033ae7926102b4cf9de6f1e /absl/debugging/internal/demangle_test.cc | |
parent | 66ef711d6846771b8e725e377de37bedae6c1527 (diff) |
Demangle elaborated type names, (Ts | Tu | Te) <name>.
PiperOrigin-RevId: 640972027
Change-Id: I810aaa10e7761686d03854abab3198be8b2868cf
Diffstat (limited to 'absl/debugging/internal/demangle_test.cc')
-rw-r--r-- | absl/debugging/internal/demangle_test.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/absl/debugging/internal/demangle_test.cc b/absl/debugging/internal/demangle_test.cc index c1308de9..0b12234f 100644 --- a/absl/debugging/internal/demangle_test.cc +++ b/absl/debugging/internal/demangle_test.cc @@ -739,6 +739,30 @@ TEST(Demangle, TypeNestedUnderDecltype) { EXPECT_STREQ("f<>()", tmp); } +TEST(Demangle, ElaboratedTypes) { + char tmp[80]; + + // Source: + // + // template <class T> struct S { class C {}; }; + // template <class T> void f(class S<T>::C) {} + // template void f<int>(class S<int>::C); + // + // LLVM demangling: + // + // void f<int>(struct S<int>::C) + EXPECT_TRUE(Demangle("_Z1fIiEvTsN1SIT_E1CE", tmp, sizeof(tmp))); + EXPECT_STREQ("f<>()", tmp); + + // The like for unions. + EXPECT_TRUE(Demangle("_Z1fIiEvTuN1SIT_E1CE", tmp, sizeof(tmp))); + EXPECT_STREQ("f<>()", tmp); + + // The like for enums. + EXPECT_TRUE(Demangle("_Z1fIiEvTeN1SIT_E1CE", tmp, sizeof(tmp))); + EXPECT_STREQ("f<>()", tmp); +} + // Test subobject-address template parameters. TEST(Demangle, SubobjectAddresses) { char tmp[80]; |