diff options
author | Jonny007-MKD <me@jonny007-mkd.de> | 2018-09-15 07:00:39 (GMT) |
---|---|---|
committer | Jonny007-MKD <me@jonny007-mkd.de> | 2018-09-15 07:00:39 (GMT) |
commit | c40f55a229f6d3d33f00c942585ea642135881db (patch) | |
tree | 5dde15d101d5424ad236077f48372c1389226fb9 | |
parent | 6494f5232b130a29321e661166442bac324c4383 (diff) | |
download | googletest-c40f55a229f6d3d33f00c942585ea642135881db.zip googletest-c40f55a229f6d3d33f00c942585ea642135881db.tar.gz googletest-c40f55a229f6d3d33f00c942585ea642135881db.tar.bz2 |
Avoid these ambiguities
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 5a1181a..50bc52d 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -1193,7 +1193,7 @@ class AdditionalMessage { public: AdditionalMessage(const char* message) : value(message) {} - AdditionalMessage& operator=(const std::string& message) { value = message; return *this; } + void set(const std::string& message) { value = message; } operator bool() const { return true; } const std::string& get() const { return value; } @@ -1242,22 +1242,22 @@ private: } \ catch (const std::exception& e) { \ if (!gtest_caught_expected) { \ - message = \ + message.set( \ "it throws a different type " \ - "with message: " + std::string(e.what()); \ + "with message: " + std::string(e.what())); \ goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ } \ } \ catch (...) { \ if (!gtest_caught_expected) { \ - message = \ - "it throws a different type."; \ + message.set( \ + "it throws a different type."); \ goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ } \ } \ if (!gtest_caught_expected) { \ - message = \ - "it throws nothing."; \ + message.set( \ + "it throws nothing."); \ goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ } \ } else \ @@ -1272,7 +1272,7 @@ private: GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ } \ catch (const std::exception& e) { \ - message = std::string(": ") + e.what(); \ + message.set(std::string(": ") + e.what()); \ goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ } \ catch (...) { \ |