Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ class TrivialFunctionAnalysisVisitor
return true;
}

bool VisitImplicitValueInitExpr(const ImplicitValueInitExpr *IVIE) {
// An implicit value initialization is trvial.
return true;
}

private:
CacheTy &Cache;
CacheTy RecursiveFn;
Expand Down
6 changes: 6 additions & 0 deletions clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ class RefCounted {
}
RefPtr<RefCounted> trivial66() { return children[0]; }
Ref<RefCounted> trivial67() { return *children[0]; }
struct point {
double x;
double y;
};
void trivial68() { point pt = { 1.0 }; }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how much this matters for the test, but doesn't this leave y uninitialized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It implicitly initializes y. That's what this bug is about. I wasn't recognizing that type of implicit initialization.


static RefCounted& singleton() {
static RefCounted s_RefCounted;
Expand Down Expand Up @@ -554,6 +559,7 @@ class UnrelatedClass {
getFieldTrivial().trivial65(); // no-warning
getFieldTrivial().trivial66()->trivial6(); // no-warning
getFieldTrivial().trivial67()->trivial6(); // no-warning
getFieldTrivial().trivial68(); // no-warning

RefCounted::singleton().trivial18(); // no-warning
RefCounted::singleton().someFunction(); // no-warning
Expand Down