[PATCH] D61106: [analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as primitive
Kristóf Umann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 25 12:58:49 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rC359230: [analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as… (authored by Szelethus, committed by ).
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61106/new/
https://reviews.llvm.org/D61106
Files:
lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
test/Analysis/cxx-uninitialized-object.cpp
Index: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
===================================================================
--- lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
+++ lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
@@ -324,7 +324,7 @@
inline bool isPrimitiveType(const QualType &T) {
return T->isBuiltinType() || T->isEnumeralType() ||
T->isMemberPointerType() || T->isBlockPointerType() ||
- T->isFunctionType();
+ T->isFunctionType() || T->isAtomicType();
}
inline bool isDereferencableType(const QualType &T) {
Index: test/Analysis/cxx-uninitialized-object.cpp
===================================================================
--- test/Analysis/cxx-uninitialized-object.cpp
+++ test/Analysis/cxx-uninitialized-object.cpp
@@ -1130,3 +1130,18 @@
// TODO: we'd expect the warning: {{2 uninitializeds field}}
CXX11MemberInitTest2(); // no-warning
}
+
+//===----------------------------------------------------------------------===//
+// _Atomic tests.
+//===----------------------------------------------------------------------===//
+
+struct MyAtomicInt {
+ _Atomic(int) x; // expected-note{{uninitialized field 'this->x'}}
+ int dontGetFilteredByNonPedanticMode = 0;
+
+ MyAtomicInt() {} // expected-warning{{1 uninitialized field}}
+};
+
+void entry() {
+ MyAtomicInt b;
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61106.196705.patch
Type: text/x-patch
Size: 1402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190425/9088948a/attachment.bin>
More information about the cfe-commits
mailing list