[PATCH] D62187: Delete default constructors, copy constructors, move constructors, copy assignment, move assignment operators on Expr, Stmt and Decl

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 00:00:46 PDT 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/include/clang/AST/DeclBase.h:374
+  Decl(const Decl&) = delete;
+  Decl(Decl &&) = delete;
+  Decl &operator=(const Decl&) = delete;
----------------
NIT: move constructors and assignments won't be generated if copy is deleted, so this is redundant.
However, feel free to keep it if you want to be more explicit.


================
Comment at: clang/include/clang/AST/Stmt.h:1057
 
+  Stmt() = delete;
   Stmt(const Stmt &) = delete;
----------------
NIT: Move the deleted declarations to the start of the class?
Or move the deleted declarations in other classes to the first public section?

(For consistency)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62187/new/

https://reviews.llvm.org/D62187





More information about the cfe-commits mailing list