[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-25 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 492115. isuckatcs added a comment. - Reverted the changes related to clang itself - Added more checks for exception handling - `isQualificationConvertiblePointer` is now iterative, not recursive - Added more test cases CHANGES SINCE LAST ACTION https://r

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-25 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs added a comment. This patch got a little bit out of control at the last revision, so I decided to remove every change from clang and add everything to the `ExceptionAnalyzer` only. The reason for that is with exceptions we have less conversions to check than we have inside the compile

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-24 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs added a comment. > E.g., instead of asserting true/false, checking if the assignment would > compile. This is actually biased. If the result of the compilation is different from the result we get from this function, it can also mean a bug in the compiler. Take a look at this example

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-24 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 491910. isuckatcs marked 9 inline comments as done. isuckatcs added a comment. Addressed comments Updated tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 Files: clang-tools-extra/clang-tidy/utils

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-24 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Not a great reviewer here as I'm not particularly sure what is going on, but I 'looked at the clang parts. Comment at: clang/include/clang/AST/ASTContext.h:2828 + static bool isQualificationConvertiblePointer(QualType From, QualType To, +

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Overall looks good to me, I wonder if the tests could be less manual though. E.g., instead of asserting true/false, checking if the assignment would compile. This way we can be sure that the method in ASTContext matches the behavior of the compiler (and we get notifie

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-24 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a reviewer: erichkeane. xazax.hun added a comment. Since now the patch touches Clang proper, adding one more reviewer. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 ___ cfe-commits

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-17 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 489940. isuckatcs added a comment. - Renamed and moved `isMultiLevelConvertiblePointer()` to `ASTContext` - Added a unit test to test the said function CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 Fil

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-16 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:81 + FromPointeeTy->getUnqualifiedDesugaredType(); + const Type *ToPointeeUQTy = ToPointeeTy->getUnqualifiedDesugaredType(); + Here I am also wonde

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-16 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:95 + + if (P1->isArrayType() && P2->isArrayType()) { +// At every level that array type is involved in, at least xazax.hun wrote: > isuckatcs wrote: > > xaz

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-16 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 489626. isuckatcs marked 7 inline comments as done. isuckatcs added a comment. Addressed comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 Files: clang-tools-extra/clang-tidy/utils/ExceptionAnal

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-16 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Also, could you open a bug report about the strange exception behavior on GitHub? Hopefully someone working on conformance can take a look. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 ___

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-16 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:60 +// Checks if T1 is convertible to T2. +static bool isMultiLevelConvertiblePointer(QualType

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-12 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:60 +// Checks if T1 is convertible to T2. +static bool isMultiLevelConvertiblePointer(QualType P1, QualType P2, + unsigned CurrentLevel

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:95 + + if (P1->isArrayType() && P2->isArrayType()) { +// At every level that array type is involved in, at least If none of the functions I recommended work

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:60 +// Checks if T1 is convertible to T2. +static bool isMultiLevelConvertiblePointer(QualType P1, QualType P2, + unsigned CurrentLevel

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2023-01-10 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:60 +// Checks if T1 is convertible to T2. +static bool isMultiLevelConvertiblePointer(QualType P1, QualType P2, + unsigned CurrentLevel

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-12-18 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-08 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs added a comment. I've found a strange scenario. The following conversions are allowed double *a[2][3]; double const * const (*ap)[3] = a; // OK double * const (*ap1)[] = a; // OK since C++20 However if the same conversion is supposed to be performed in a `catch()` stateme

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-08 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 466312. isuckatcs marked 2 inline comments as done. isuckatcs added a comment. Addressed comments and added support for multi-level pointers too. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 Files:

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-08 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:81 + isBaseOf(TPointeeUQTy, BPointeeUQTy)) && + (TCVR == 0 || (BCVR ^ TCVR) == 0 || (BCVR & TCVR) > BCVR)) { +TypesToDelete.push_back(T); --

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-08 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 466269. isuckatcs marked an inline comment as done. isuckatcs added a comment. Addressed inline comment CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 Files: clang-tools-extra/clang-tidy/utils/Excepti

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:68 + + auto BPointeeUQTy = BPointeeTy->getUnqualifiedDesugaredType(); + auto TPointeeUQTy = TPointeeTy->getUnqualifiedDesugaredType(); Please don'

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-07 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs updated this revision to Diff 466204. isuckatcs edited the summary of this revision. isuckatcs added a comment. Updated CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135495/new/ https://reviews.llvm.org/D135495 Files: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp

[PATCH] D135495: [clang-tidy] handle pointers in `ExceptionAnalyzer`

2022-10-07 Thread Domján Dániel via Phabricator via cfe-commits
isuckatcs created this revision. isuckatcs added reviewers: njames93, baloghadamsoftware, aaron.ballman, LegalizeAdulthood. Herald added subscribers: carlosgalvezp, manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, a.sidorin, rnkovacs, xazax.hun. Herald added a project: All. isuckatcs requeste