[PATCH] Improve diagnostic message for misplaced square brackets

Richard Smith richard at metafoo.co.uk
Tue Jun 24 08:58:26 PDT 2014


Looks great, with one tweak.

================
Comment at: lib/Parse/ParseDecl.cpp:5646-5649
@@ +5645,6 @@
+
+  // Nothing after the brackets has been parsed as part of the Declarator, so
+  // no correction is needed.
+  if (OldEndLoc == D.getLocEnd())
+    return;
+
----------------
This looks unreachable. If nothing after the brackets has been parsed, then there can't be an identifier, so we should have bailed out already. Remove?

http://reviews.llvm.org/D2712






More information about the cfe-commits mailing list