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;
+}


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;
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to