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. 4 5 #include "weak_ptr_factory.h" 6 namespace should_succeed { 7 8 class OnlyMember { 9 base::WeakPtrFactory<OnlyMember> factory_; 10 }; 11 12 class FactoryLast { 13 bool bool_member_; 14 int int_member_; 15 base::WeakPtrFactory<FactoryLast> factory_; 16 }; 17 18 class FactoryRefersToOtherType { 19 bool bool_member_; 20 base::WeakPtrFactory<bool> bool_ptr_factory_; 21 }; 22 23 class FirstFactoryRefersToOtherType { 24 bool bool_member_; 25 base::WeakPtrFactory<bool> bool_ptr_factory_; 26 int int_member_; 27 base::WeakPtrFactory<FirstFactoryRefersToOtherType> factory_; 28 }; 29 30 } // namespace should_succeed 31 32 namespace should_fail { 33 34 class FactoryFirst { 35 base::WeakPtrFactory<FactoryFirst> factory_; 36 int int_member; 37 }; 38 39 class FactoryMiddle { 40 bool bool_member_; 41 base::WeakPtrFactory<FactoryMiddle> factory_; 42 int int_member_; 43 }; 44 45 } // namespace should_fail 46 47 int main() { 48 } 49 50