Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3546)

Unified Diff: base/memory/scoped_ptr_unittest.nc

Issue 9283028: Add scoped_ptr<>::PassAs<>(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/memory/scoped_ptr_unittest.nc
diff --git a/base/memory/scoped_ptr_unittest.nc b/base/memory/scoped_ptr_unittest.nc
new file mode 100644
index 0000000000000000000000000000000000000000..841d03c7eda9fa3f243e2d971b2a9feab7fe052d
--- /dev/null
+++ b/base/memory/scoped_ptr_unittest.nc
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace {
+
+class Parent {
+};
+
+class Child : public Parent {
+};
+
+} // namespace
+
+#if defined(NCTEST_NO_PASSAS_DOWNCAST) // [r"invalid conversion from"]
+
+scoped_ptr<Child> DowncastUsingPassAs(scoped_ptr<Parent> object) {
+ return object.PassAs<Child>();
+}
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698