Index: clang-tidy/readability/IdentifierNamingCheck.cpp =================================================================== --- clang-tidy/readability/IdentifierNamingCheck.cpp +++ clang-tidy/readability/IdentifierNamingCheck.cpp @@ -395,6 +395,9 @@ if (Decl->isAnonymousStructOrUnion()) return SK_Invalid; + if (!Decl->getCanonicalDecl()->isThisDeclarationADefinition()) + return SK_Invalid; + if (Decl->hasDefinition() && Decl->isAbstract() && NamingStyles[SK_AbstractClass].isSet()) return SK_AbstractClass; Index: test/clang-tidy/readability-identifier-naming.cpp =================================================================== --- test/clang-tidy/readability-identifier-naming.cpp +++ test/clang-tidy/readability-identifier-naming.cpp @@ -190,6 +190,11 @@ // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for class member 'ClassMember_2' // CHECK-FIXES: {{^}} static int ClassMember2;{{$}} }; +class my_class; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'my_class' +// CHECK-FIXES: {{^}}class CMyClass;{{$}} + +class my_forward_declared_class; // No warning should be triggered. const int my_class::classConstant = 4; // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for class constant 'classConstant'