Skip to content

Commit b7d52f6

Browse files
mhxfacebook-github-bot
authored andcommitted
fix: std::copy in small_vector can trigger GCC -Warray-bounds (#2223)
Summary: Pull Request resolved: #2223 Reviewed By: Gownta Differential Revision: D58197967 Pulled By: Orvid fbshipit-source-id: db99b9817d6c620be35330414195c6025ef2523c
1 parent c8d66aa commit b7d52f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

folly/container/small_vector.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,10 @@ class small_vector
10371037

10381038
void copyWholeInlineStorageTrivial(small_vector const& o) {
10391039
static_assert(std::is_trivially_copyable_v<Value>);
1040+
FOLLY_PUSH_WARNING
1041+
FOLLY_GCC_DISABLE_WARNING("-Warray-bounds")
10401042
std::copy(o.u.buffer(), o.u.buffer() + MaxInline, u.buffer());
1043+
FOLLY_POP_WARNING
10411044
this->setSize(o.size());
10421045
}
10431046

0 commit comments

Comments
 (0)