[PATCH] D40813: [clang-tidy] Adding Fuchsia checker for virtual inheritance

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 12:04:13 PST 2017


juliehockett added inline comments.


================
Comment at: test/clang-tidy/fuchsia-virtual-inheritance.cpp:34-36
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: constructing a class that inherits a virtual base class is disallowed [fuchsia-virtual-inheritance]
+  // CHECK-NEXT:  D(int value) : A(value), B(), C() {}
+  // CHECK-MESSAGES: [[@LINE-3]]:33: warning: constructing a class that inherits a virtual base class is disallowed [fuchsia-virtual-inheritance]
----------------
aaron.ballman wrote:
> I'm also not certain this should be diagnosed either. It's technically correct because it's calling the base class constructors here, but at the same time, it seems very low-value and likely to cause the user to do something really bad, like silence the warning by not calling the base class constructors.
I see what you mean, but where then would you draw the line between warning and not? We could warn for construction everywhere except in initialization lists, but that seems like it might open the door to trivially get around the check in ways that should be disallowed.


https://reviews.llvm.org/D40813





More information about the cfe-commits mailing list