From a827fb79585ef92e27c40a5dda6e145777e94be9 Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Mon, 17 Dec 2018 21:07:38 +0000 Subject: [PATCH] [analyzer] MoveChecker: Squash the bit field because it causes a GCC warning. The warning seems spurious (GCC bug 51242), but the bit field is simply not worth the hassle. rdar://problem/41349073 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349394 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Checkers/MoveChecker.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/StaticAnalyzer/Checkers/MoveChecker.cpp b/lib/StaticAnalyzer/Checkers/MoveChecker.cpp index 6436a6c6cb..6efa2dfbe5 100644 --- a/lib/StaticAnalyzer/Checkers/MoveChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MoveChecker.cpp @@ -63,9 +63,7 @@ public: private: enum MisuseKind { MK_FunCall, MK_Copy, MK_Move, MK_Dereference }; - // This needs to be unsigned in order to avoid undefined behavior - // when putting it into a tight bitfield. - enum StdObjectKind : unsigned { SK_NonStd, SK_Unsafe, SK_Safe, SK_SmartPtr }; + enum StdObjectKind { SK_NonStd, SK_Unsafe, SK_Safe, SK_SmartPtr }; enum AggressivenessKind { // In any case, don't warn after a reset. AK_Invalid = -1, @@ -81,9 +79,9 @@ private: struct ObjectKind { // Is this a local variable or a local rvalue reference? - bool IsLocal : 1; + bool IsLocal; // Is this an STL object? If so, of what kind? - StdObjectKind StdKind : 2; + StdObjectKind StdKind; }; // STL smart pointers are automatically re-initialized to null when moved -- 2.50.1