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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 12:48:54 PST 2018


aaron.ballman 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>();
----------------
rsmith wrote:
> 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.
Ah, I must have mis-remembered these APIs. Thanks, @rsmith and sorry for the noise @juliehockett!


https://reviews.llvm.org/D40580





More information about the cfe-commits mailing list