[PATCH] D126077: Fix stack crash in classIsDerivedFrom triggered by clang-tidy

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 22 04:00:39 PDT 2022


njames93 edited reviewers, added: aaron.ballman, njames93, alexfh, LegalizeAdulthood; removed: bixia, aartbik.
njames93 added a comment.

Do you know of any other instances where this issue could surface?

Please can you add a line to the `Improved Checks` section in `clang-tools-extra/docs/ReleaseNotes.rst` about this fix. Make sure it is in alphabetical order.



================
Comment at: clang-tools-extra/test/clang-tidy/infrastructure/recursive-templates.cpp:2
+// Regression test: shouldn't crash.
+// RUN: clang-tidy %s -checks='*' -- | FileCheck %s
+template<typename T> struct t1;
----------------
Can you narrow down the check list to just include a check is causing the crash.
Also given we are only ensuring there is no crash, we don't need to invoke FileCheck. clang-tidy will return non-zero if it crashes, causing the whole test to fail.


================
Comment at: clang-tools-extra/test/clang-tidy/infrastructure/recursive-templates.cpp:8
+int main() {
+  return 0;
+}
----------------
This is different to the reproducer in the bug report as it doesn't have an instantiation of the struct in this test, unlike the bug report.


================
Comment at: clang-tools-extra/test/clang-tidy/infrastructure/recursive-templates.cpp:11-13
+namespace i {
+}
+// CHECK: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment]
----------------
Definitely unrelated to this check and could safely be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126077



More information about the cfe-commits mailing list