aaron.ballman added a comment.

Some minor nits; @rsmith may have more substantial comments.


================
Comment at: lib/Sema/SemaChecking.cpp:11039
@@ -11036,2 +11038,3 @@
     std::function<void(Expr *, RecordDecl *, ValueDecl *, CharUnits)> Action) {
+  // return;
   const auto *ME = dyn_cast<MemberExpr>(E);
----------------
Spurious comment.

================
Comment at: lib/Sema/SemaChecking.cpp:11049
@@ -11044,5 +11048,3 @@
     ValueDecl *MD = ME->getMemberDecl();
-    bool ByteAligned = Context.getTypeAlignInChars(MD->getType()).isOne();
-    if (ByteAligned) // Attribute packed does not have any effect.
-      break;
+    auto AlignField = Context.getTypeAlignInChars(MD->getType());
 
----------------
Please don't use auto here as the type is not spelled out in the initialization.

================
Comment at: lib/Sema/SemaChecking.cpp:11053
@@ +11052,3 @@
+    if (RD->hasAttr<PackedAttr>() || MD->hasAttr<PackedAttr>()) {
+      auto AlignRecord = Context.getTypeAlignInChars(BaseType);
+      if ((RequiredAlignment > AlignRecord) ||
----------------
Don't use auto here either.


https://reviews.llvm.org/D23657



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to