[PATCH] D148418: [clang-tidy] Fix typedefs handling in bugprone-dangling-handle

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 15 03:14:32 PDT 2023


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


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp:55-56
 
-  operator basic_string_view() const noexcept;
+  typedef basic_string_view str_view;
+  operator str_view() const noexcept;
 
----------------
carlosgalvezp wrote:
> Right now the test will no longer test classes that have the conversion operator written explicitly instead of via typedef. Do you think it's worth keeping the other implementation as well, or can we safely assume that `basic_string` is always implemented like this?
Both GCC (__sv_type) & Clang (__self_view) implement this using typedef.
But code will work fine also without typedef.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148418



More information about the cfe-commits mailing list