[PATCH] D135495: [clang-tidy] handle exceptions properly `ExceptionAnalyzer`

Domján Dániel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 21 08:31:09 PST 2023


isuckatcs marked an inline comment as done.
isuckatcs added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:84
+
+QualType getPointeeOrArrayElementQualType(QualType T) {
+  if (T->isAnyPointerType())
----------------
xazax.hun wrote:
> What about `Type::getPointeeOrArrayElementType`?
I didn't use that for two reasons.


  # It returns a `Type` instead of a `QualType`, so the qualifiers are lost.
  # It uses `Type::getBaseElementTypeUnsafe()` for arrays, which discards all array types for multi-dimensional arrays. E.g.: `int[2][3]` will become `int` and I want to take only one step backward, so I want `int[2][3]` to become `int[2]`.

I was thinking about inserting this function into `Type` or `QualType` but because of the different behaviour with arrays I decided to use it as a helper in this source file only instead. I agree that the naming is confusing a bit, but it is literally what the function does.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135495/new/

https://reviews.llvm.org/D135495



More information about the cfe-commits mailing list