[clang-tools-extra] 7b6174b - Add a test file that was missed in e477988309dbde214a6d16ec690a416882714aac

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 13:52:45 PDT 2019


Author: Daniel
Date: 2019-10-30T16:52:19-04:00
New Revision: 7b6174bb147957b4695023ae57c95ca07af7b917

URL: https://github.com/llvm/llvm-project/commit/7b6174bb147957b4695023ae57c95ca07af7b917
DIFF: https://github.com/llvm/llvm-project/commit/7b6174bb147957b4695023ae57c95ca07af7b917.diff

LOG: Add a test file that was missed in e477988309dbde214a6d16ec690a416882714aac

Added: 
    clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-bugfix-name-conflicts.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-bugfix-name-conflicts.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-bugfix-name-conflicts.cpp
new file mode 100644
index 000000000000..12ddcf55c119
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-bugfix-name-conflicts.cpp
@@ -0,0 +1,27 @@
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
+// RUN:   -config='{CheckOptions: [ \
+// RUN:     {key: readability-identifier-naming.ParameterCase, value: lower_case} \
+// RUN:   ]}'
+
+int func(int Break) {
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for parameter 'Break'; cannot be fixed because 'break' would conflict with a keyword
+  // CHECK-FIXES: {{^}}int func(int Break) {{{$}}
+  if (Break == 1) {
+    // CHECK-FIXES: {{^}}  if (Break == 1) {{{$}}
+    return 2;
+  }
+
+  return 0;
+}
+
+#define foo 3
+int func2(int Foo) {
+  // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for parameter 'Foo'; cannot be fixed because 'foo' would conflict with a macro definition
+  // CHECK-FIXES: {{^}}int func2(int Foo) {{{$}}
+  if (Foo == 1) {
+    // CHECK-FIXES: {{^}}  if (Foo == 1) {{{$}}
+    return 2;
+  }
+
+  return 0;
+}


        


More information about the cfe-commits mailing list