| OLD | NEW |
| (Empty) | |
| 1 // Test file for the empty string clang tool. |
| 2 |
| 3 #include <string> |
| 4 |
| 5 // Tests for std::string declarations. |
| 6 void TestDeclarations() { std::string a(""), b("abc"), c(""); } |
| 7 |
| 8 // Tests for std::string allocated with new. |
| 9 void TestNew() { |
| 10 std::string* a = new std::string(""), |
| 11 *b = new std::string("abc"), |
| 12 *c = new std::string(""), |
| 13 *d = new std::string(); |
| 14 } |
| 15 |
| 16 // Tests for std::string construction in initializer lists. |
| 17 class TestInitializers { |
| 18 public: |
| 19 TestInitializers() : a("") {} |
| 20 TestInitializers(bool) : a(""), b("") {} |
| 21 TestInitializers(double) : a(""), b("cat"), c() {} |
| 22 |
| 23 private: |
| 24 std::string a; |
| 25 std::string b; |
| 26 std::string c; |
| 27 }; |
| 28 |
| 29 // Tests for temporary std::strings. |
| 30 void TestTemporaries(const std::string& reference_argument, |
| 31 const std::string value_argument) { |
| 32 TestTemporaries("", ""); |
| 33 TestTemporaries(std::string(""), std::string("")); |
| 34 } |
| OLD | NEW |