1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/memory/scoped_ptr.h"
7 void TestDeclarations() {
8 scoped_ptr<int> a, b(new int), c;
9 scoped_ptr_malloc<int> d;
13 scoped_ptr<int>* a = new scoped_ptr<int>, *b = new scoped_ptr<int>(new int),
14 *c = new scoped_ptr<int>;
17 class TestInitializers {
20 TestInitializers(bool) {}
21 TestInitializers(double)
22 : b(new int), c(), f(static_cast<int*>(malloc(sizeof(int)))) {}
28 scoped_ptr_malloc<int> d;
29 scoped_ptr_malloc<int> e;
30 scoped_ptr_malloc<int> f;
33 scoped_ptr<int> TestTemporaries(scoped_ptr<int> a, scoped_ptr<int> b) {
35 TestTemporaries(scoped_ptr<int>(), scoped_ptr<int>(new int));
36 return scoped_ptr<int>();