[PATCH] D131686: [clang-tidy] Add test to cert-dcl58-cpp.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 08:31:43 PDT 2022


balazske created this revision.
Herald added subscribers: steakhal, martong, gamesh411, Szelethus, dkrupp, xazax.hun.
Herald added a project: All.
balazske requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Add a test to cert-dcl58-cpp.cpp to verify that crash in github
issue #56902 does not happen.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131686

Files:
  clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp


Index: clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp
@@ -268,3 +268,16 @@
 inline constexpr bool numeric_limits<::ranges::detail::LongT>::is_signed;
 inline constexpr bool numeric_limits<::ranges::detail::LongT>::is_integer;
 } // namespace std
+
+namespace no_crash {
+struct A
+{
+  friend struct B;
+};
+
+struct B;
+
+template<typename> struct T {};
+
+T<B> b;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131686.451869.patch
Type: text/x-patch
Size: 584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220811/a3aed230/attachment.bin>


More information about the cfe-commits mailing list