From 4e5ff1559ca3bd7bb777a1c48106464cb656e041 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Fri, 2 Dec 2022 12:43:54 -0800 Subject: Add a compilation test for recursive hash map types PiperOrigin-RevId: 492535520 Change-Id: I2e58b39bd4ab3064f675474c5e712c76fac02674 --- absl/container/node_hash_map_test.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'absl/container/node_hash_map_test.cc') diff --git a/absl/container/node_hash_map_test.cc b/absl/container/node_hash_map_test.cc index e941a836..9bcf470c 100644 --- a/absl/container/node_hash_map_test.cc +++ b/absl/container/node_hash_map_test.cc @@ -272,6 +272,14 @@ TEST(NodeHashMap, NodeHandleMutableKeyAccess) { } #endif +TEST(NodeHashMap, RecursiveTypeCompiles) { + struct RecursiveType { + node_hash_map m; + }; + RecursiveType t; + t.m[0] = RecursiveType{}; +} + } // namespace } // namespace container_internal ABSL_NAMESPACE_END -- cgit v1.2.3