From 0c1a394036f899212957992918546bd402ba7239 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 30 Jul 2020 14:02:07 -0400 Subject: [PATCH 355/377] FIXME: add g++.dg/analyzer/pr94503.C --- gcc/testsuite/g++.dg/analyzer/pr94503.C | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/analyzer/pr94503.C diff --git a/gcc/testsuite/g++.dg/analyzer/pr94503.C b/gcc/testsuite/g++.dg/analyzer/pr94503.C new file mode 100644 index 00000000000..9432ac40764 --- /dev/null +++ b/gcc/testsuite/g++.dg/analyzer/pr94503.C @@ -0,0 +1,25 @@ +template class allocator { +public: + allocator(const allocator &); + allocator(); +}; + +template struct allocator_traits; +template struct allocator_traits > { + static allocator<_Tp> select_on_container_copy_construction() { + return allocator<_Tp>(); + } + static allocator<_Tp> _S_select_on_copy() { + return select_on_container_copy_construction(); + } +}; + +class basic_string { + struct _Alloc_hider { + _Alloc_hider(allocator); + } _M_dataplus; + +public: + basic_string(basic_string &) + : _M_dataplus(allocator_traits >::_S_select_on_copy()) {} +} xxx(xxx); -- 2.26.2