diff options
author | James Dennett <jdennett@google.com> | 2018-05-21 17:59:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 17:59:24 (GMT) |
commit | ec2c911b3370f6536b90bf8de7be742ac191c25f (patch) | |
tree | ba56ac728e26bf7e956217adad922e1e5595f9f8 /googletest | |
parent | 89286a4cdf503c421c6156af19a6013b7d4a98c9 (diff) | |
download | googletest-ec2c911b3370f6536b90bf8de7be742ac191c25f.zip googletest-ec2c911b3370f6536b90bf8de7be742ac191c25f.tar.gz googletest-ec2c911b3370f6536b90bf8de7be742ac191c25f.tar.bz2 |
Downgrade to C++98 code.
Some users are not ready for C++11 yet.
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/include/gtest/internal/gtest-type-util.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/googletest/include/gtest/internal/gtest-type-util.h b/googletest/include/gtest/internal/gtest-type-util.h index d0d83f5..d778131 100644 --- a/googletest/include/gtest/internal/gtest-type-util.h +++ b/googletest/include/gtest/internal/gtest-type-util.h @@ -62,12 +62,12 @@ namespace internal { // used by various standard libraries (e.g., `std::__1`). Names outside // of namespace std are returned unmodified. inline std::string CanonicalizeForStdLibVersioning(std::string s) { - static constexpr char prefix[] = "std::__"; + static const char prefix[] = "std::__"; if (s.compare(0, strlen(prefix), prefix) == 0) { - auto end = s.find("::", strlen(prefix)); + std::string::size_type end = s.find("::", strlen(prefix)); if (end != s.npos) { - // Erase the `::__` plus whatever was between that and the next `::`. - s.erase(strlen("std"), strlen("::__") + end - strlen(prefix)); + // Erase everything between the initial `std` and the second `::`. + s.erase(strlen("std"), end - strlen("std")); } } return s; @@ -89,9 +89,9 @@ std::string GetTypeName() { using abi::__cxa_demangle; # endif // GTEST_HAS_CXXABI_H_ char* const readable_name = __cxa_demangle(name, 0, 0, &status); - std::string name_str(status == 0 ? readable_name : name); + const std::string name_str(status == 0 ? readable_name : name); free(readable_name); - return CanonicalizeForStdLibVersioning(std::move(name_str)); + return CanonicalizeForStdLibVersioning(name_str); # else return name; # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC |