diff options
author | Abseil Team <absl-team@google.com> | 2023-03-06 10:26:02 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-03-06 10:27:01 -0800 |
commit | dc44b95ab0cc988afd225d0eb9f7021f96fcd2b6 (patch) | |
tree | 3899b6f828ee9a5138ded9087cf3be1a5f84f6f3 /absl/functional/function_ref_test.cc | |
parent | 807763a7f57dcf0ba4af7c3b218013e8f525e811 (diff) |
Support lvalue references to incomplete types as `FunctionRef` parameters.
PiperOrigin-RevId: 514451518
Change-Id: Ic1391374c7bff08ba437ac0410631d1f701bb9ed
Diffstat (limited to 'absl/functional/function_ref_test.cc')
-rw-r--r-- | absl/functional/function_ref_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/absl/functional/function_ref_test.cc b/absl/functional/function_ref_test.cc index 412027cd..d0923fdd 100644 --- a/absl/functional/function_ref_test.cc +++ b/absl/functional/function_ref_test.cc @@ -253,6 +253,16 @@ TEST(FunctionRef, PassByValueTypes) { } } +TEST(FunctionRef, ReferenceToIncompleteType) { + struct IncompleteType; + auto test = [](IncompleteType&) {}; + absl::FunctionRef<void(IncompleteType&)> ref(test); + + struct IncompleteType {}; + IncompleteType obj; + ref(obj); +} + } // namespace ABSL_NAMESPACE_END } // namespace absl |