This revision was automatically updated to reflect the committed changes.
Closed by commit rGd4cb6c208231: [clang-tidy] readability-identifier-naming: 
fix hungarian enum prefix in C (authored by amurzeau, committed by PiotrZSL).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h
@@ -0,0 +1,58 @@
+#pragma once
+
+// clang-format off
+typedef signed char         int8_t;     // NOLINT
+typedef short               int16_t;    // NOLINT
+typedef long                int32_t;    // NOLINT
+typedef long long           int64_t;    // NOLINT
+typedef unsigned char       uint8_t;    // NOLINT
+typedef unsigned short      uint16_t;   // NOLINT
+typedef unsigned long       uint32_t;   // NOLINT
+typedef unsigned long long  uint64_t;   // NOLINT
+#ifndef _WIN32
+typedef unsigned long long  size_t;     // NOLINT
+#endif
+typedef long                intptr_t;   // NOLINT
+typedef unsigned long       uintptr_t;  // NOLINT
+typedef long int            ptrdiff_t;  // NOLINT
+typedef unsigned char       BYTE;       // NOLINT
+typedef unsigned short      WORD;       // NOLINT
+typedef unsigned long       DWORD;      // NOLINT
+typedef int                 BOOL;       // NOLINT
+typedef int                 BOOLEAN;    // NOLINT
+typedef float               FLOAT;      // NOLINT
+typedef int                 INT;        // NOLINT
+typedef unsigned int        UINT;       // NOLINT
+typedef unsigned long       ULONG;      // NOLINT
+typedef short               SHORT;      // NOLINT
+typedef unsigned short      USHORT;     // NOLINT
+typedef char                CHAR;       // NOLINT
+typedef unsigned char       UCHAR;      // NOLINT
+typedef signed char         INT8;       // NOLINT
+typedef signed short        INT16;      // NOLINT
+typedef signed int          INT32;      // NOLINT
+typedef signed long long    INT64;      // NOLINT
+typedef unsigned char       UINT8;      // NOLINT
+typedef unsigned short      UINT16;     // NOLINT
+typedef unsigned int        UINT32;     // NOLINT
+typedef unsigned long long  UINT64;     // NOLINT
+typedef long                LONG;       // NOLINT
+typedef signed int          LONG32;     // NOLINT
+typedef unsigned int        ULONG32;    // NOLINT
+typedef uint64_t            ULONG64;    // NOLINT
+typedef unsigned int        DWORD32;    // NOLINT
+typedef uint64_t            DWORD64;    // NOLINT
+typedef uint64_t            ULONGLONG;  // NOLINT
+typedef void*               PVOID;      // NOLINT
+typedef void*               HANDLE;     // NOLINT
+typedef void*               FILE;       // NOLINT
+
+#define NULL                (0)         // NOLINT
+
+#ifndef __cplusplus
+typedef _Bool               bool;       // NOLINT
+typedef __WCHAR_TYPE__      wchar_t;    // NOLINT
+#define true                1           // NOLINT
+#define false               0           // NOLINT
+#endif
+// clang-format on
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -1,53 +1,7 @@
-// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
+// RUN:   --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy -- -I %S
 
-// clang-format off
-typedef signed char         int8_t;     // NOLINT
-typedef short               int16_t;    // NOLINT
-typedef long                int32_t;    // NOLINT
-typedef long long           int64_t;    // NOLINT
-typedef unsigned char       uint8_t;    // NOLINT
-typedef unsigned short      uint16_t;   // NOLINT
-typedef unsigned long       uint32_t;   // NOLINT
-typedef unsigned long long  uint64_t;   // NOLINT
-#ifndef _WIN32
-typedef unsigned long long  size_t;     // NOLINT
-#endif
-typedef long                intptr_t;   // NOLINT
-typedef unsigned long       uintptr_t;  // NOLINT
-typedef long int            ptrdiff_t;  // NOLINT
-typedef unsigned char       BYTE;       // NOLINT
-typedef unsigned short      WORD;       // NOLINT
-typedef unsigned long       DWORD;      // NOLINT
-typedef int                 BOOL;       // NOLINT
-typedef int                 BOOLEAN;    // NOLINT
-typedef float               FLOAT;      // NOLINT
-typedef int                 INT;        // NOLINT
-typedef unsigned int        UINT;       // NOLINT
-typedef unsigned long       ULONG;      // NOLINT
-typedef short               SHORT;      // NOLINT
-typedef unsigned short      USHORT;     // NOLINT
-typedef char                CHAR;       // NOLINT
-typedef unsigned char       UCHAR;      // NOLINT
-typedef signed char         INT8;       // NOLINT
-typedef signed short        INT16;      // NOLINT
-typedef signed int          INT32;      // NOLINT
-typedef signed long long    INT64;      // NOLINT
-typedef unsigned char       UINT8;      // NOLINT
-typedef unsigned short      UINT16;     // NOLINT
-typedef unsigned int        UINT32;     // NOLINT
-typedef unsigned long long  UINT64;     // NOLINT
-typedef long                LONG;       // NOLINT
-typedef signed int          LONG32;     // NOLINT
-typedef unsigned int        ULONG32;    // NOLINT
-typedef uint64_t            ULONG64;    // NOLINT
-typedef unsigned int        DWORD32;    // NOLINT
-typedef uint64_t            DWORD64;    // NOLINT
-typedef uint64_t            ULONGLONG;  // NOLINT
-typedef void*               PVOID;      // NOLINT
-typedef void*               HANDLE;     // NOLINT
-typedef void*               FILE;       // NOLINT
-#define NULL                (0)         // NOLINT
-// clang-format on
+#include "identifier-naming-standard-types.h"
 
 // clang-format off
 //===----------------------------------------------------------------------===//
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
@@ -1,53 +1,7 @@
-// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
+// RUN:   --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy -- -I %S
 
-// clang-format off
-typedef signed char         int8_t;     // NOLINT
-typedef short               int16_t;    // NOLINT
-typedef long                int32_t;    // NOLINT
-typedef long long           int64_t;    // NOLINT
-typedef unsigned char       uint8_t;    // NOLINT
-typedef unsigned short      uint16_t;   // NOLINT
-typedef unsigned long       uint32_t;   // NOLINT
-typedef unsigned long long  uint64_t;   // NOLINT
-#ifndef _WIN32
-typedef unsigned long long  size_t;     // NOLINT
-#endif
-typedef long                intptr_t;   // NOLINT
-typedef unsigned long       uintptr_t;  // NOLINT
-typedef long int            ptrdiff_t;  // NOLINT
-typedef unsigned char       BYTE;       // NOLINT
-typedef unsigned short      WORD;       // NOLINT
-typedef unsigned long       DWORD;      // NOLINT
-typedef int                 BOOL;       // NOLINT
-typedef int                 BOOLEAN;    // NOLINT
-typedef float               FLOAT;      // NOLINT
-typedef int                 INT;        // NOLINT
-typedef unsigned int        UINT;       // NOLINT
-typedef unsigned long       ULONG;      // NOLINT
-typedef short               SHORT;      // NOLINT
-typedef unsigned short      USHORT;     // NOLINT
-typedef char                CHAR;       // NOLINT
-typedef unsigned char       UCHAR;      // NOLINT
-typedef signed char         INT8;       // NOLINT
-typedef signed short        INT16;      // NOLINT
-typedef signed int          INT32;      // NOLINT
-typedef signed long long    INT64;      // NOLINT
-typedef unsigned char       UINT8;      // NOLINT
-typedef unsigned short      UINT16;     // NOLINT
-typedef unsigned int        UINT32;     // NOLINT
-typedef unsigned long long  UINT64;     // NOLINT
-typedef long                LONG;       // NOLINT
-typedef signed int          LONG32;     // NOLINT
-typedef unsigned int        ULONG32;    // NOLINT
-typedef uint64_t            ULONG64;    // NOLINT
-typedef unsigned int        DWORD32;    // NOLINT
-typedef uint64_t            DWORD64;    // NOLINT
-typedef uint64_t            ULONGLONG;  // NOLINT
-typedef void*               PVOID;      // NOLINT
-typedef void*               HANDLE;     // NOLINT
-typedef void*               FILE;       // NOLINT
-#define NULL                (0)         // NOLINT
-// clang-format on
+#include "identifier-naming-standard-types.h"
 
 // clang-format off
 //===----------------------------------------------------------------------===//
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
@@ -1,92 +1,23 @@
-// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
+// RUN:   --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy -- -I %S
 
-// clang-format off
-typedef signed char         int8_t;     // NOLINT
-typedef short               int16_t;    // NOLINT
-typedef long                int32_t;    // NOLINT
-typedef long long           int64_t;    // NOLINT
-typedef unsigned char       uint8_t;    // NOLINT
-typedef unsigned short      uint16_t;   // NOLINT
-typedef unsigned long       uint32_t;   // NOLINT
-typedef unsigned long long  uint64_t;   // NOLINT
-#ifndef _WIN32
-typedef unsigned long long  size_t;     // NOLINT
-#endif
-typedef long                intptr_t;   // NOLINT
-typedef unsigned long       uintptr_t;  // NOLINT
-typedef long int            ptrdiff_t;  // NOLINT
-typedef unsigned char       BYTE;       // NOLINT
-typedef unsigned short      WORD;       // NOLINT
-typedef unsigned long       DWORD;      // NOLINT
-typedef int                 BOOL;       // NOLINT
-typedef int                 BOOLEAN;    // NOLINT
-typedef float               FLOAT;      // NOLINT
-typedef int                 INT;        // NOLINT
-typedef unsigned int        UINT;       // NOLINT
-typedef unsigned long       ULONG;      // NOLINT
-typedef short               SHORT;      // NOLINT
-typedef unsigned short      USHORT;     // NOLINT
-typedef char                CHAR;       // NOLINT
-typedef unsigned char       UCHAR;      // NOLINT
-typedef signed char         INT8;       // NOLINT
-typedef signed short        INT16;      // NOLINT
-typedef signed int          INT32;      // NOLINT
-typedef signed long long    INT64;      // NOLINT
-typedef unsigned char       UINT8;      // NOLINT
-typedef unsigned short      UINT16;     // NOLINT
-typedef unsigned int        UINT32;     // NOLINT
-typedef unsigned long long  UINT64;     // NOLINT
-typedef long                LONG;       // NOLINT
-typedef signed int          LONG32;     // NOLINT
-typedef unsigned int        ULONG32;    // NOLINT
-typedef uint64_t            ULONG64;    // NOLINT
-typedef unsigned int        DWORD32;    // NOLINT
-typedef uint64_t            DWORD64;    // NOLINT
-typedef uint64_t            ULONGLONG;  // NOLINT
-typedef void*               PVOID;      // NOLINT
-typedef void*               HANDLE;     // NOLINT
-typedef void*               FILE;       // NOLINT
-#define NULL                (0)         // NOLINT
-// clang-format on
+#include "identifier-naming-standard-types.h"
 
 // clang-format off
 //===----------------------------------------------------------------------===//
 // Cases to CheckOptions
 //===----------------------------------------------------------------------===//
-class CMyClass1 {
-public:
-  static int ClassMemberCase;
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for class member 'ClassMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static int iClassMemberCase;
-
-  char const ConstantMemberCase = 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for constant member 'ConstantMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char const cConstantMemberCase = 0;
-
-  void MyFunc1(const int ConstantParameterCase);
-  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for constant parameter 'ConstantParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc1(const int iConstantParameterCase);
-
-  void MyFunc2(const int* ConstantPointerParameterCase);
-  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: invalid case style for pointer parameter 'ConstantPointerParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc2(const int* piConstantPointerParameterCase);
-
-  static constexpr int ConstexprVariableCase = 123;
-  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: invalid case style for constexpr variable 'ConstexprVariableCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static constexpr int iConstexprVariableCase = 123;
-};
-
 const int GlobalConstantCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
 
-const int* GlobalConstantPointerCase = nullptr;
+const int* GlobalConstantPointerCase = NULL;
 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = nullptr;
+// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = NULL;
 
-int* GlobalPointerCase = nullptr;
+int* GlobalPointerCase = NULL;
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'GlobalPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int* piGlobalPointerCase = nullptr;
+// CHECK-FIXES: {{^}}int* piGlobalPointerCase = NULL;
 
 int GlobalVariableCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalVariableCase' [readability-identifier-naming]
@@ -101,52 +32,23 @@
   // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for local constant 'ConstantCase' [readability-identifier-naming]
   // CHECK-FIXES: {{^}}  unsigned const uConstantCase = 1;
 
-  int* const LocalConstantPointerCase = nullptr;
+  int* const LocalConstantPointerCase = NULL;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for local constant pointer 'LocalConstantPointerCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int* const piLocalConstantPointerCase = nullptr;
+  // CHECK-FIXES: {{^}}  int* const piLocalConstantPointerCase = NULL;
 
-  int *LocalPointerCase = nullptr;
+  int *LocalPointerCase = NULL;
   // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for local pointer 'LocalPointerCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int *piLocalPointerCase = nullptr;
+  // CHECK-FIXES: {{^}}  int *piLocalPointerCase = NULL;
 
   int LocalVariableCase = 0;
   // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for local variable 'LocalVariableCase' [readability-identifier-naming]
   // CHECK-FIXES: {{^}}  int iLocalVariableCase = 0;
 }
 
-class CMyClass2 {
+struct CMyClass2 {
   char MemberCase;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for private member 'MemberCase' [readability-identifier-naming]
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for public member 'MemberCase' [readability-identifier-naming]
   // CHECK-FIXES: {{^}}  char cMemberCase;
-
-  void Func1(int ParameterCase);
-  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for parameter 'ParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void Func1(int iParameterCase);
-
-  void Func2(const int ParameterCase);
-  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: invalid case style for constant parameter 'ParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void Func2(const int iParameterCase);
-
-  void Func3(const int *PointerParameterCase);
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: invalid case style for pointer parameter 'PointerParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void Func3(const int *piPointerParameterCase);
-};
-
-class CMyClass3 {
-private:
-  char PrivateMemberCase;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for private member 'PrivateMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char cPrivateMemberCase;
-
-protected:
-  char ProtectedMemberCase;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for protected member 'ProtectedMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char cProtectedMemberCase;
-
-public:
-  char PublicMemberCase;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for public member 'PublicMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char cPublicMemberCase;
 };
 
 static const int StaticConstantCase = 3;
@@ -192,26 +94,6 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global variable 'WideNamePtrArray' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}const wchar_t *pwszWideNamePtrArray[] = {L"AA", L"BB"};
 
-class CMyClass4 {
-private:
-  char *Name = "Text";
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for private member 'Name' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char *szName = "Text";
-
-  const char *ConstName = "Text";
-  // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for private member 'ConstName' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  const char *szConstName = "Text";
-
-public:
-  const char* DuplicateString(const char* Input, size_t nRequiredSize);
-  // CHECK-MESSAGES: :[[@LINE-1]]:43: warning: invalid case style for pointer parameter 'Input' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  const char* DuplicateString(const char* szInput, size_t nRequiredSize);
-
-  size_t UpdateText(const char* Buffer, size_t nBufferSize);
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: invalid case style for pointer parameter 'Buffer' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  size_t UpdateText(const char* szBuffer, size_t nBufferSize);
-};
-
 
 //===----------------------------------------------------------------------===//
 // Microsoft Windows data types
@@ -406,24 +288,6 @@
 // CHECK-FIXES: {{^}}void MyFunc2(void* pVal){}
 
 
-//===----------------------------------------------------------------------===//
-// Reference
-//===----------------------------------------------------------------------===//
-int iValueIndex = 1;
-int &RefValueIndex = iValueIndex;
-// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'RefValueIndex' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int &iRefValueIndex = iValueIndex;
-
-const int &ConstRefValue = iValueIndex;
-// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'ConstRefValue' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int &iConstRefValue = iValueIndex;
-
-long long llValueLongLong = 2;
-long long &RefValueLongLong = llValueLongLong;
-// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'RefValueLongLong' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}long long &llRefValueLongLong = llValueLongLong;
-
-
 //===----------------------------------------------------------------------===//
 // Various types
 //===----------------------------------------------------------------------===//
@@ -583,25 +447,10 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'VolatileInt' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}volatile int iVolatileInt = 0;
 
-thread_local int ThreadLocalValueInt = 0;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for global variable 'ThreadLocalValueInt' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}thread_local int iThreadLocalValueInt = 0;
-
 extern int ExternValueInt;
 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'ExternValueInt' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}extern int iExternValueInt;
 
-struct DataBuffer {
-    mutable size_t Size;
-};
-// CHECK-MESSAGES: :[[@LINE-2]]:20: warning: invalid case style for public member 'Size' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}    mutable size_t nSize;
-
-static constexpr int const &ConstExprInt = 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: invalid case style for constexpr variable 'ConstExprInt' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}static constexpr int const &iConstExprInt = 42;
-
-
 //===----------------------------------------------------------------------===//
 // Redefined types
 //===----------------------------------------------------------------------===//
@@ -611,25 +460,6 @@
 // CHECK-FIXES: {{^}}INDEX Index = 0;
 
 
-//===----------------------------------------------------------------------===//
-// Class
-//===----------------------------------------------------------------------===//
-class ClassCase { int Func(); };
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'ClassCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}class CClassCase { int Func(); };
-
-class AbstractClassCase { virtual int Func() = 0; };
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for abstract class 'AbstractClassCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}class IAbstractClassCase { virtual int Func() = 0; };
-
-class AbstractClassCase1 { virtual int Func1() = 0; int Func2(); };
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for abstract class 'AbstractClassCase1' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}class IAbstractClassCase1 { virtual int Func1() = 0; int Func2(); };
-
-class ClassConstantCase { public: static const int iConstantCase; };
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'ClassConstantCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}class CClassConstantCase { public: static const int iConstantCase; };
-
 //===----------------------------------------------------------------------===//
 // Other Cases
 //===----------------------------------------------------------------------===//
@@ -704,8 +534,3 @@
 // 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 };
-
-enum class ScopedEnumConstantCase { Case1 };
-// CHECK-MESSAGES: :[[@LINE-1]]:37: warning: invalid case style for scoped enum constant 'Case1' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}enum class ScopedEnumConstantCase { seccCase1 };
-// clang-format on
Index: clang-tools-extra/docs/ReleaseNotes.rst
===================================================================
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -201,6 +201,12 @@
   :doc:`readability-identifier-naming
   <clang-tidy/checks/readability/identifier-naming>` check.
 
+- Updated the Hungarian prefixes for enums in C files to match those used in C++
+  files for improved readability, as checked by :doc:`readability-identifier-naming
+  <clang-tidy/checks/readability/identifier-naming>`. To preserve the previous
+  behavior of using `i` as the prefix for enum tags, set the `EnumConstantPrefix`
+  option to `i` instead of using `EnumConstantHungarianPrefix`.
+
 - Fixed a false positive in :doc:`readability-container-size-empty
   <clang-tidy/checks/readability/container-size-empty>` check when comparing
   ``std::array`` objects to default constructed ones. The behavior for this and
Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -648,7 +648,9 @@
 
 std::string IdentifierNamingCheck::HungarianNotation::getEnumPrefix(
     const EnumConstantDecl *ECD) const {
-  std::string Name = ECD->getType().getAsString();
+  const EnumDecl *ED = cast<EnumDecl>(ECD->getDeclContext());
+
+  std::string Name = ED->getName().str();
   if (std::string::npos != Name.find("enum")) {
     Name = Name.substr(strlen("enum"), Name.length() - strlen("enum"));
     Name = Name.erase(0, Name.find_first_not_of(" "));
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to