[PATCH] D40580: [clang-tidy] Adding Fuchsia checker for multiple inheritance

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 12:33:55 PST 2018


rsmith added inline comments.


================
Comment at: clang-tidy/fuchsia/MultipleInheritanceCheck.cpp:60
+  // To be an interface, all base classes must be interfaces as well.
+  for (const auto &I : Node->bases()) {
+    const auto *Ty = I.getType()->getAs<RecordType>();
----------------
aaron.ballman wrote:
> juliehockett wrote:
> > aaron.ballman wrote:
> > > What about virtual bases (`Node->vbases()`)? This would also be worth some test cases.
> > Added test cases for virtual, but aren't virtual bases also included in `bases()`?
> No, they are separate in `CXXRecordDecl`.
That's not quite right. `bases()` contains all direct bases, regardless of whether or not they're virtual. `vbases()` contains all virtual bases, regardless of whether or not they're direct.


https://reviews.llvm.org/D40580





More information about the cfe-commits mailing list