[PATCH] D52552: [clang-tidy] Flag Classes Inheriting From Structs

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 26 12:15:05 PDT 2018


lebedev.ri added inline comments.


================
Comment at: test/clang-tidy/misc-class-inherit-from-struct.cpp:13
+};
+
+class C
----------------
lebedev.ri wrote:
> 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?
Also, i have only thought about it, there are no tests about what happens if you (say, publicly) inherit from `struct`, that does not have anything `public`.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52552





More information about the cfe-commits mailing list