Skip to content

[analyzer][NFC] Add a test case to PR-70792 for Issue-59493 #71073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
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
20 changes: 20 additions & 0 deletions clang/test/Analysis/issue-70464.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,23 @@ struct Derived : Base {
void entry() { Derived test; }

} // namespace delegate_ctor_call

// Additional test case from issue #59493
namespace init_list_array {

struct Base {
int foox[1];
};

class Derived : public Base {
public:
Derived() : Base{{42}} {
// The dereference to this->foox below should be initialized properly.
clang_analyzer_dump(this->foox[0]); // expected-warning{{42 S32b}}
clang_analyzer_dump(foox[0]); // expected-warning{{42 S32b}}
}
};

void entry() { Derived test; }

} // namespace init_list_array