[Syntax] Disallow invalid Node operations
authorSam McCall <sam.mccall@gmail.com>
Mon, 26 Oct 2020 15:44:36 +0000 (16:44 +0100)
committerSam McCall <sam.mccall@gmail.com>
Tue, 27 Oct 2020 07:36:35 +0000 (08:36 +0100)
commitc6a05eb62f2ab392eba4e7a056e95c821587ae47
treea5983af3eba58bd07981ff6941c579fbd947fefc
parentf385823e04f300c92ec03dbd660d621cc618a271
[Syntax] Disallow invalid Node operations

Copy/move break invariants (move could be fixed).
Node/Tree should have no public constructors, they're abstract.
Destructor is private to enforce arena allocation.

(Making the constructor of all subclasses private doesn't seem worthwhile)

Differential Revision: https://reviews.llvm.org/D90163
clang/include/clang/Tooling/Syntax/Tree.h