[PATCH] Implement DR7

David Majnemer david.majnemer at gmail.com
Thu Jun 6 03:51:56 PDT 2013


The attached patch implements DR7 [*], disallowing deriving from classes
that have private virtual base classes except in instances where the
deriving would be able to cast itself to the private virtual base via a
different derivation.

To demonstrate:

class Foo { public: Foo() {}  ~Foo() {} };
class Bar : virtual private Foo { public: Bar() {}  ~Bar() {} };
class Qux : public Bar { public: Qux() {}  ~Qux() {} };
class GreaterQux : public Bar, virtual public Foo { public: GreaterQux() {}
 ~GreaterQux() {} };

[*] http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#7

-- 
David Majnemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130606/9baa6f2a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DR7.diff
Type: application/octet-stream
Size: 3336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130606/9baa6f2a/attachment.obj>


More information about the cfe-commits mailing list