lebedev.ri added a comment. Please upload patches with full context. Please do follow coding style, clang-format your patches.
Would it make sense to not catch-all all the `class : struct`, but consider the explicitly specified inheritance visibility? ================ Comment at: clang-tidy/misc/ClassInheritFromStructCheck.cpp:21 +void ClassInheritFromStructCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher(cxxRecordDecl(isClass(),unless(isImplicit()),isDerivedFrom(cxxRecordDecl(isStruct()))).bind("class"), this); +} ---------------- Please linewrap to 80 chars. ================ Comment at: test/clang-tidy/misc-class-inherit-from-struct.cpp:13 +}; + +class C ---------------- Missing cases: * struct inheriting from struct * Different inheritance visibility: * You only check the default visibility * What if class explicitly-`public`ly inherits from `struct`? * What if class explicitly-`private`ly inherits from `struct`? * What if class explicitly-`protected`ly inherits from `struct`? * Same for `struct` inheriting from struct? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52552 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits