| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <utility> | |
| 6 | |
| 7 class Foo { | 5 class Foo { |
| 8 public: | 6 public: |
| 9 void foo() {} | 7 void foo() {} |
| 10 }; | 8 }; |
| 11 | 9 |
| 12 void f(); | 10 void f(); |
| 13 | 11 |
| 14 int main() { | 12 int main() { |
| 15 int integer; | 13 int integer; |
| 16 Foo foo; | 14 Foo foo; |
| 17 | 15 |
| 18 auto int_copy = integer; | 16 auto int_copy = integer; |
| 19 const auto const_int_copy = integer; | 17 const auto const_int_copy = integer; |
| 20 const auto& const_int_ref = integer; | 18 const auto& const_int_ref = integer; |
| 21 | 19 |
| 22 auto raw_int_ptr = &integer; | 20 auto raw_int_ptr = &integer; |
| 23 const auto const_raw_int_ptr = &integer; | 21 const auto const_raw_int_ptr = &integer; |
| 24 const auto& const_raw_int_ptr_ref = &integer; | 22 const auto& const_raw_int_ptr_ref = &integer; |
| 25 | 23 |
| 26 auto* raw_int_ptr_valid = &integer; | 24 auto* raw_int_ptr_valid = &integer; |
| 27 const auto* const_raw_int_ptr_valid = &integer; | 25 const auto* const_raw_int_ptr_valid = &integer; |
| 28 | 26 |
| 29 auto raw_foo_ptr = &foo; | 27 auto raw_foo_ptr = &foo; |
| 30 const auto const_raw_foo_ptr = &foo; | 28 const auto const_raw_foo_ptr = &foo; |
| 31 const auto& const_raw_foo_ptr_ref = &foo; | 29 const auto& const_raw_foo_ptr_ref = &foo; |
| 32 | 30 |
| 33 auto* raw_foo_ptr_valid = &foo; | 31 auto* raw_foo_ptr_valid = &foo; |
| 34 const auto* const_raw_foo_ptr_valid = &foo; | 32 const auto* const_raw_foo_ptr_valid = &foo; |
| 35 | 33 |
| 36 int *int_ptr; | 34 int* int_ptr; |
| 37 | 35 |
| 38 auto double_ptr_auto = &int_ptr; | 36 auto double_ptr_auto = &int_ptr; |
| 39 auto* double_ptr_auto_ptr = &int_ptr; | 37 auto* double_ptr_auto_ptr = &int_ptr; |
| 40 auto** double_ptr_auto_double_ptr = &int_ptr; | 38 auto** double_ptr_auto_double_ptr = &int_ptr; |
| 41 | 39 |
| 42 auto function_ptr = &f; | 40 auto function_ptr = &f; |
| 43 auto method_ptr = &Foo::foo; | 41 auto method_ptr = &Foo::foo; |
| 44 | 42 |
| 45 int *const *const volatile **const *pointer_awesomeness; | 43 int* const* const volatile** const* pointer_awesomeness; |
| 46 auto auto_awesome = pointer_awesomeness; | 44 auto auto_awesome = pointer_awesomeness; |
| 47 | 45 |
| 48 auto& int_ptr_ref = int_ptr; | 46 auto& int_ptr_ref = int_ptr; |
| 49 const auto& const_int_ptr_ref = int_ptr; | 47 const auto& const_int_ptr_ref = int_ptr; |
| 50 auto&& int_ptr_rref = std::move(int_ptr); | 48 auto&& int_ptr_rref = static_cast<int*&&>(int_ptr); |
| 51 const auto&& const_int_ptr_rref = std::move(int_ptr); | 49 const auto&& const_int_ptr_rref = static_cast<int*&&>(int_ptr); |
| 52 } | 50 } |
| OLD | NEW |