1 // Copyright 2016 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 class Foo { 6 public: foo()7 void foo() {} 8 }; 9 10 void f(); 11 main()12int main() { 13 int integer; 14 Foo foo; 15 16 auto int_copy = integer; 17 const auto const_int_copy = integer; 18 const auto& const_int_ref = integer; 19 20 auto raw_int_ptr = &integer; 21 const auto const_raw_int_ptr = &integer; 22 const auto& const_raw_int_ptr_ref = &integer; 23 24 auto* raw_int_ptr_valid = &integer; 25 const auto* const_raw_int_ptr_valid = &integer; 26 27 auto raw_foo_ptr = &foo; 28 const auto const_raw_foo_ptr = &foo; 29 const auto& const_raw_foo_ptr_ref = &foo; 30 31 auto* raw_foo_ptr_valid = &foo; 32 const auto* const_raw_foo_ptr_valid = &foo; 33 34 int* int_ptr; 35 36 auto double_ptr_auto = &int_ptr; 37 auto* double_ptr_auto_ptr = &int_ptr; 38 auto** double_ptr_auto_double_ptr = &int_ptr; 39 40 auto function_ptr = &f; 41 auto method_ptr = &Foo::foo; 42 43 int* const* const volatile** const* pointer_awesomeness; 44 auto auto_awesome = pointer_awesomeness; 45 46 auto& int_ptr_ref = int_ptr; 47 const auto& const_int_ptr_ref = int_ptr; 48 auto&& int_ptr_rref = static_cast<int*&&>(int_ptr); 49 const auto&& const_int_ptr_rref = static_cast<int*&&>(int_ptr); 50 } 51