[PATCH] D39166: [NFC] Add some assertions to placate my paranoia about sharing a variant bit across FunctionDecl and CXXDeductionGuideDecl - should I do this?

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 12:13:58 PDT 2017


aaron.ballman added a comment.

I'll let Richard comment on whether this pattern is reasonable or not, but I have some very minor nits in the meantime.



================
Comment at: include/clang/AST/Decl.h:1683
   // Since a Deduction Guide [C++17] will never have a body, we can share the
-  // storage, and use a different name.
+  // storage, and use a different name.  Since WillHaveBody is not serialized we
+  // don't need to worry about collisions there.
----------------
Since -> Because

(Might as well fix the other one as well while you're at it.)


================
Comment at: include/clang/AST/InlineDeclMembers.h:10
+//
+//  This file defines the Decl subclasses.
+//
----------------
This comment seems incorrect.


================
Comment at: include/clang/AST/InlineDeclMembers.h:20
+
+
+inline bool clang::FunctionDecl::willHaveBody() const {
----------------
Spurious newline.

Because this functionality will always be for inline Decl members, I think it would make more sense to put the declarations into `namespace clang` rather than use a qualified name.


================
Comment at: include/clang/AST/InlineDeclMembers.h:34
+
+
+#endif  //LLVM_CLANG_AST_INLINEDECLMEMBERS_H
----------------
Another spurious newline.


================
Comment at: include/clang/AST/InlineDeclMembers.h:35
+
+#endif  //LLVM_CLANG_AST_INLINEDECLMEMBERS_H
+
----------------
Whitespace is incorrect here.


Repository:
  rL LLVM

https://reviews.llvm.org/D39166





More information about the cfe-commits mailing list