mattbeardsley created this revision.
mattbeardsley added a reviewer: kbobyrev.
Herald added a subscriber: xazax.hun.
mattbeardsley requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.
Herald added a project: clang-tools-extra.

The clang-tidy/infrastructure/pr37091.cpp test inherits the top-level 
.clang-tidy configuration because it doesn't specify its own checks, which ends 
up including misc-RenameFcn. This results in an assert when built with 
"-DCMAKE_BUILD_TYPE=Debug" because fQualifiedName is an empty string in 
"hasName(fQualifiedName)" in RenamefcnCheck.cpp (because none of the config 
options for misc-RenameFcn are provided - not that they should be). The 
HasNameMatcher::HasNameMatcher implementation behind hasName(...) asserts on 
empty strings.

Fixed in 2 ways:

- make the clang-tidy/infrastructure/pr37091.cpp test independent of the 
top-level .clang-tidy (picked an arbitrary check that I saw another 
clang-tidy/infrastructure test was also using: 
clang-tidy/infrastructure/temporaries.cpp)
- It's not useful for the top-level .clang-tidy to have misc-RenameFcn enabled 
anyway, so disabled that

(each of those changes fixes the debug-only assert in 
clang-tidy/infrastructure/pr37091.cpp on its own, but I thought each change had 
its own merits)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114034

Files:
  .clang-tidy
  clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp


Index: clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
+++ clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
@@ -6,5 +6,5 @@
 //
 // Verify that no temporary files are left behind by the clang-tidy invocation.
 
-// RUN: env TMPDIR=%t TEMP=%t TMP=%t clang-tidy %s -- --target=mips64
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t clang-tidy 
-checks='-*,clang-analyzer-core.NullDereference' %s -- --target=mips64
 // RUN: rmdir %t
Index: .clang-tidy
===================================================================
--- .clang-tidy
+++ .clang-tidy
@@ -1,4 +1,4 @@
-Checks: 
'-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,readability-identifier-naming'
+Checks: 
'-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-RenameFcn,readability-identifier-naming'
 CheckOptions:
   - key:             readability-identifier-naming.ClassCase
     value:           CamelCase


Index: clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
+++ clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
@@ -6,5 +6,5 @@
 //
 // Verify that no temporary files are left behind by the clang-tidy invocation.
 
-// RUN: env TMPDIR=%t TEMP=%t TMP=%t clang-tidy %s -- --target=mips64
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t clang-tidy -checks='-*,clang-analyzer-core.NullDereference' %s -- --target=mips64
 // RUN: rmdir %t
Index: .clang-tidy
===================================================================
--- .clang-tidy
+++ .clang-tidy
@@ -1,4 +1,4 @@
-Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,readability-identifier-naming'
+Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-RenameFcn,readability-identifier-naming'
 CheckOptions:
   - key:             readability-identifier-naming.ClassCase
     value:           CamelCase
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to