[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-02-02 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. While we were there, we also dug into `std::any`, and learned that the analyzer can model it shockingly well. Hopefully we can submit a few patches that demonstrates it in a form of some test files. In D142354#4079758 ,

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In D142354#4079643 , @Szelethus wrote: >> In the latter case, have you explored the possibility of force-inlining the >> class instead, like I suggested in the thread? > > I have done some tests then, and figured that the analyzer

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I would be interested in some of the free-functions dealing with variants, such as `std::visit()`. https://godbolt.org/z/bbocrz4dG I hope that's also on the radar. In D142354#4079643 , @Szelethus wrote: > In D142354#4078450

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D142354#4078450 , @NoQ wrote: > Interesting, what specific goals do you have here? Are you planning to find > specific bugs (eg. force-unwrap to a wrong type) or just to model the > semantics? Hi! Meant to write this

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-24 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Interesting, what specific goals do you have here? Are you planning to find specific bugs (eg. force-unwrap to a wrong type) or just to model the semantics? In the latter case, have you explored the possibility of force-inlining the class instead, like I suggested in the

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-24 Thread Gábor Spaits via Phabricator via cfe-commits
spaits updated this revision to Diff 491816. spaits added a comment. Adding mock header for std::variant. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142354/new/ https://reviews.llvm.org/D142354 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-24 Thread Gábor Spaits via Phabricator via cfe-commits
spaits added a comment. Thank you for your response @steakhal! I am going to define a mock standard variant header. I was thinking about just copying the definitions from the original variant header but it had other headers as dependency. I will write my own variant definition one step at the

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I'm very much interrested. I think you should define a mock standard variant header, that you could include from your tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142354/new/ https://reviews.llvm.org/D142354

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-23 Thread Gábor Spaits via Phabricator via cfe-commits
spaits created this revision. spaits added reviewers: Szelethus, steakhal, NoQ, gamesh411, xazax.hun. spaits added a project: clang. Herald added subscribers: manas, ASDenysPetrov, martong, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. Herald added a