diff --git a/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h b/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h index 3c2c5c453c42..a0d3e56b1cee 100644 --- a/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h +++ b/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h @@ -324,7 +324,7 @@ private: 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) { diff --git a/clang/test/Analysis/cxx-uninitialized-object.cpp b/clang/test/Analysis/cxx-uninitialized-object.cpp index bcd3d85d0fd0..86f2ecdd83a8 100644 --- a/clang/test/Analysis/cxx-uninitialized-object.cpp +++ b/clang/test/Analysis/cxx-uninitialized-object.cpp @@ -1130,3 +1130,18 @@ void fCXX11MemberInitTest2() { // 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; +}