[PATCH] Improve diagnostic message for misplaced square brackets

Richard Trieu rtrieu at google.com
Tue Jun 10 18:49:58 PDT 2014


Clean up brackets.cpp test case
Add new tests for reference variables
Use ParseDeclaratorInternal instead of ParseDirectDeclarator
Remove use of token stream mangling and backtracking
Skip the error message when the closing paren comes before the opening paren in the fix-it hint

The main difference is restarting the parse earlier with ParseDeclaratorInternal, which allows for parsing the leading '*' and '&' tokens in "int [1] *foo" and "int [2] &bar"

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.10311.patch
Type: text/x-patch
Size: 14402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140611/66b81864/attachment.bin>


More information about the cfe-commits mailing list