amurzeau added a comment.

In D144912#4203920 <https://reviews.llvm.org/D144912#4203920>, @carlosgalvezp 
wrote:

> Looks good but I fail to understand what exactly the patch fixes, can you 
> point me to an example in the tests?

The patch fixes these enum tests in C language mode:

  enum REV_TYPE { RevValid };
  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for enum 
constant 'RevValid' [readability-identifier-naming]
  // CHECK-FIXES: {{^}}enum REV_TYPE { rtRevValid };
  
  enum EnumConstantCase { OneByte, TwoByte };
  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: invalid case style for enum 
constant 'OneByte' [readability-identifier-naming]
  // CHECK-MESSAGES: :[[@LINE-2]]:34: warning: invalid case style for enum 
constant 'TwoByte' [readability-identifier-naming]
  // CHECK-FIXES: {{^}}enum EnumConstantCase { eccOneByte, eccTwoByte };

Without this patch, the suggested fix in a C file by clang-tidy is `iRevValid` 
instead of `rtRevValid`.
This patch makes the behavior on C files the same as C++ files.

In D144912#4203920 <https://reviews.llvm.org/D144912#4203920>, @carlosgalvezp 
wrote:

> It would be easier to review if the NFC changes had been done in a separate 
> patch.

Ok sorry, will do that next time.
Would the new C test file would have been better in a separate patch too (thus 
keep only the main change in the checker) ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to