[PATCH] Add more information when displaying a "read-only variable is not assignable" error

Richard Smith richard at metafoo.co.uk
Fri Apr 10 15:37:54 PDT 2015


LGTM, but I think the loop can be simplified slightly:


================
Comment at: lib/Sema/SemaExpr.cpp:8859
@@ +8858,3 @@
+      break;
+    } // End MemberExpr
+
----------------
Every code path below this point reaches a `break;` -- maybe end the loop here?

================
Comment at: lib/Sema/SemaExpr.cpp:8874
@@ +8873,3 @@
+            << FD->getReturnTypeSourceRange();
+        return;
+      }
----------------
The function will return anyway, because `DiagnosticEmitted` is now `true`. Remove this `return` for consistency with the other cases?

================
Comment at: lib/Sema/SemaExpr.cpp:8876
@@ +8875,3 @@
+      }
+      E = CE->getCallee()->IgnoreImpCasts();
+      break;
----------------
This looks like a dead store. Remove?

http://reviews.llvm.org/D4479

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list