[PATCH] Improve diagnostic message for misplaced square brackets

Richard Trieu rtrieu at google.com
Tue May 13 15:44:22 PDT 2014


Switching to a recursive solution for misplaced brackets.  Upon seeing a bracket before the identifier, parse the brackets and store the info.  Call ParseDirectDeclarator again to continue parsing.  After that returns, attach the bracket info the Declarator and emit the misplaced bracket error with fix-it hint to move the brackets after the identifier.  Additionally, store the location of the beginning of the brackets so that other error messages may point to a better location.

http://reviews.llvm.org/D2712

Files:
  include/clang/Basic/DiagnosticParseKinds.td
  include/clang/Parse/Parser.h
  lib/Parse/ParseDecl.cpp
  test/Parser/brackets.c
  test/Parser/brackets.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2712.9367.patch
Type: text/x-patch
Size: 13088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140513/47430cc7/attachment.bin>


More information about the cfe-commits mailing list