rsmith added inline comments.

================
Comment at: lib/Sema/SemaType.cpp:1253-1254
@@ -1252,4 +1253,4 @@
       break;
     } else if (declarator.getContext() == Declarator::LambdaExprContext ||
                isOmittedBlockReturnType(declarator)) {
       Result = Context.DependentTy;
----------------
Instead of checking for qualifiers below, how about checking here (or, 
preferably, in `isOmittedBlockReturnType`) whether there were any present, and 
not treating the block as having an omitted return type if there actually is a 
return type present?

================
Comment at: lib/Sema/SemaType.cpp:1561
@@ +1560,3 @@
+    AttributeList *cur = attrs, *prev = nullptr;
+    while (cur) {
+      AttributeList &attr = *cur;
----------------
Maybe write this as `for (AttributeList *cur = attrs; cur; cur = 
cur->getNext())` and drop the `cur = cur->getNext()` assignments below.

================
Comment at: lib/Sema/SemaType.cpp:1575-1583
@@ +1574,11 @@
+      // Remove cur from the list.
+      if (attrs == cur) {
+        attrs = attr.getNext();
+        prev = nullptr;
+        cur = cur->getNext();
+        continue;
+      }
+      prev->setNext(attr.getNext());
+      prev = cur;
+      cur = cur->getNext();
+    }
----------------
You can express this more simply as:

  if (prev)
    prev->setNext(cur->getNext());
  else
    attrs = cur->getNext();
  cur = cur->getNext();



http://reviews.llvm.org/D18567



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

Reply via email to