zeyi2 wrote:

> Making a relevant test is a bit challenging to me has the issue is to say 
> that an invalid code that use to crash the binary now just show the correct 
> error. I'm looking into it.

I think you can use invalid code with `-expect-clang-tidy-error` in the `// 
RUN` line.

You can use 
`./clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-no-infinite-loop.cpp`
 as a reference :)

```
// RUN: %check_clang_tidy -expect-clang-tidy-error %s 
readability-isolate-declaration %t

int main(){
  int a, b
  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple declarations in a single 
statement reduces readability
  // CHECK-MESSAGES: [[@LINE-2]]:11: error: expected ';' at end of declaration 
[clang-diagnostic-error]
}
```

https://github.com/llvm/llvm-project/pull/220093
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to