Add new diagnostic messages when too many arguments are presented to a
authorRichard Trieu <rtrieu@google.com>
Tue, 23 Jul 2013 18:01:49 +0000 (18:01 +0000)
committerRichard Trieu <rtrieu@google.com>
Tue, 23 Jul 2013 18:01:49 +0000 (18:01 +0000)
commit79b45389c3cd2f1ab0904b636f8451849038cddf
treed5a8d314e7d002bf2bd9af5c6ab1c9287b7b9459
parent8c4245455ad4ad171387ec8dac33a28fa58da84b
Add new diagnostic messages when too many arguments are presented to a
function-like macro.  Clang will attempt to correct the arguments by detecting
braced initializer lists:

1) If possible, suggest parentheses around arguments
containing braced lists which will give the proper number of arguments.
2) If a braced list is detected at the start of a macro argument, it cannot be
corrected by parentheses.  Instead, just point out the location of these
braced lists.

llvm-svn: 186971
clang/include/clang/Basic/Diagnostic.h
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/lib/Lex/PPMacroExpansion.cpp
clang/test/Preprocessor/macro_fn.c
clang/test/Preprocessor/macro_with_initializer_list.cpp [new file with mode: 0644]