Index: tools/clang/rewrite_scoped_refptr/tests/temp-assigned-to-field-init-original.cc |
diff --git a/tools/clang/rewrite_scoped_refptr/tests/test10-expected.cc b/tools/clang/rewrite_scoped_refptr/tests/temp-assigned-to-field-init-original.cc |
similarity index 56% |
copy from tools/clang/rewrite_scoped_refptr/tests/test10-expected.cc |
copy to tools/clang/rewrite_scoped_refptr/tests/temp-assigned-to-field-init-original.cc |
index a74cd7df9336d8cb9a80f3b4952beb6cea30c6df..c81503ce4a02e9c1907c2d8b508adbfcb8a7899c 100644 |
--- a/tools/clang/rewrite_scoped_refptr/tests/test10-expected.cc |
+++ b/tools/clang/rewrite_scoped_refptr/tests/temp-assigned-to-field-init-original.cc |
@@ -8,9 +8,12 @@ struct Foo { |
int dummy; |
}; |
-int TestsAScopedRefptr() { |
- scoped_refptr<Foo> foo(new Foo); |
- if (foo.get()) |
- return 1; |
- return 0; |
+// Similar to case 2, but with a field initializer. |
+scoped_refptr<Foo> GetBuggyFoo() { |
+ return new Foo; |
} |
+ |
+class ABuggyCtor { |
+ ABuggyCtor() : f_(GetBuggyFoo()) {} |
+ Foo* f_; |
+}; |