diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2016-11-07 20:34:16 +0000 |
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2016-11-07 20:34:16 +0000 |
| commit | f1271c8d087273af381e2ae5e447c2314c4a1f74 (patch) | |
| tree | ff19f2990221c3f354a7a22057962a88a8337d41 /clang/test/FixIt/fixit-nullability-declspec.cpp | |
| parent | 7b48463d3d80509eeca2ed3fa23f7e41d0b954eb (diff) | |
| download | bcm5719-llvm-f1271c8d087273af381e2ae5e447c2314c4a1f74.tar.gz bcm5719-llvm-f1271c8d087273af381e2ae5e447c2314c4a1f74.zip | |
Disallow StringRef assignment from temporary std::strings.
Similar to r283798, this prevents accidentally referring to temporary
storage that goes out of scope by the end of the statement:
someStringRef = getStringByValue();
someStringRef = (Twine("-") + otherString).str();
Note that once again the constructor still has this problem:
StringRef someStringRef = getStringByValue();
because once again we occasionally rely on this in calls:
takesStringRef(getStringByValue());
takesStringRef(Twine("-") + otherString);
Still, it's a step.
llvm-svn: 286139
Diffstat (limited to 'clang/test/FixIt/fixit-nullability-declspec.cpp')
0 files changed, 0 insertions, 0 deletions

