From d2469bc9e84a30190295ef2af0a85f4bb4802dd0 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Jul 2013 18:04:23 +0200 Subject: [PATCH] CppRewriter: Treat libc++'s std::__1:: as std:: for debugger display Change-Id: Iabc1330633e5568b7c94059d4286c93adfecb1a2 Reviewed-by: Nikolai Kosjar Reviewed-by: Erik Verbruggen --- src/libs/cplusplus/CppRewriter.cpp | 1 + .../auto/cplusplus/simplifytypes/tst_simplifytypestest.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp index 008249344c2..65191194e26 100644 --- a/src/libs/cplusplus/CppRewriter.cpp +++ b/src/libs/cplusplus/CppRewriter.cpp @@ -527,6 +527,7 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn) if (type.startsWith(QLatin1String("struct "))) type.remove(0, 7); + type.replace(QLatin1String("std::__1::"), QLatin1String("std::")); type.replace(QLatin1Char('*'), QLatin1Char('@')); for (int i = 0; i < 10; ++i) { diff --git a/tests/auto/cplusplus/simplifytypes/tst_simplifytypestest.cpp b/tests/auto/cplusplus/simplifytypes/tst_simplifytypestest.cpp index e13a1ba8410..5f8349b54fb 100644 --- a/tests/auto/cplusplus/simplifytypes/tst_simplifytypestest.cpp +++ b/tests/auto/cplusplus/simplifytypes/tst_simplifytypestest.cpp @@ -42,6 +42,7 @@ const char *description[] = "g++_stringset", "g++_stringvector", "g++_wstringvector", + "libc++_stringvector", "msvc_stdstring", "msvc_stdwstring", "msvc_stringmap", @@ -63,6 +64,8 @@ const char *input[] = "std::set, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > > >", "std::vector, std::allocator >, std::allocator, std::allocator > > >", "std::vector, std::allocator >, std::allocator, std::allocator > > >", +// libc++ +"std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >", // MSVC "class std::basic_string,std::allocator >", "class std::basic_string,std::allocator >", @@ -76,6 +79,7 @@ const char *input[] = const char *output[] = { + // Gcc "std::string", "std::wstring", "std::map", @@ -84,6 +88,9 @@ const char *output[] = "std::set", "std::vector", "std::vector", + // libc++ + "std::vector", + // MSVC "std::string", "std::wstring", "std::map",