Provide a better diagnostic when braces are put before the identifier.
authorRichard Trieu <rtrieu@google.com>
Tue, 24 Jun 2014 23:14:24 +0000 (23:14 +0000)
committerRichard Trieu <rtrieu@google.com>
Tue, 24 Jun 2014 23:14:24 +0000 (23:14 +0000)
commitf4b81d0029653c2592b5aa9305bd59e37729c463
tree7b8873ccd4aeda9e0d7be5cbc329e0ec0c143cdf
parente49e30357b49aa9d8da2b2199312344f6a87fbc4
Provide a better diagnostic when braces are put before the identifier.

When a user types:
  int [4] foo;
assume that the user means:
  int foo[4];

Update the information for 'foo' to prevent additional errors, and provide
a fix-it hint to move the brackets to the correct location.

Additionally, suggest parens for types that require it, such as:
  int [4] *foo;
to:
  int (*foo)[4];

llvm-svn: 211641
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseDecl.cpp
clang/test/Parser/brackets.c [new file with mode: 0644]
clang/test/Parser/brackets.cpp [new file with mode: 0644]