llvm-project/clang/test/FixIt
Richard Smith 8d06f42448 Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:
- If the declarator is at the start of a line, and the previous line contained
   another declarator and ended with a comma, then that comma was probably a
   typo for a semicolon:

   int n = 0, m = 1, l = 2, // k = 5;
   myImportantFunctionCall(); // oops!

 - If removing the parentheses would correctly initialize the object, then
   produce a note suggesting that fix.

 - Otherwise, if there is a simple initializer we can suggest which performs
   value-initialization, then provide a note suggesting a correction to that
   initializer.

Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.

llvm-svn: 148072
2012-01-12 23:53:29 +00:00
..
auto-fixit.m Provide Fixit warning when 'auto' is intended as storage 2011-02-22 23:17:49 +00:00
dereference-addressof.c Add */& mismatch fixit generation to the Sema::DiagnoseAssignmentResult(). 2011-07-28 19:51:27 +00:00
fixit-c90.c Teach clang -fixit to modify files in-place, or -fixit=suffix to create new 2010-04-24 01:30:46 +00:00
fixit-cxx0x.cpp Update C++11 scoped enumeration support to match the final proposal: 2012-01-10 01:33:14 +00:00
fixit-errors-1.c Teach clang -fixit to modify files in-place, or -fixit=suffix to create new 2010-04-24 01:30:46 +00:00
fixit-errors.c PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so: 2011-09-06 03:01:15 +00:00
fixit-function-call.cpp PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so: 2011-09-06 03:01:15 +00:00
fixit-missing-method-return-type.m PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so: 2011-09-06 03:01:15 +00:00
fixit-objc-message.m PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so: 2011-09-06 03:01:15 +00:00
fixit-objc.m Introduce a Fix-It for the "missing sentinel" warning, adding an 2011-07-30 08:57:03 +00:00
fixit-pmem.cpp Teach clang -fixit to modify files in-place, or -fixit=suffix to create new 2010-04-24 01:30:46 +00:00
fixit-static-object-decl.m PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so: 2011-09-06 03:01:15 +00:00
fixit-suffix.c Teach clang -fixit to modify files in-place, or -fixit=suffix to create new 2010-04-24 01:30:46 +00:00
fixit-unrecoverable.c Implement a new identifier-classification scheme where Sema 2011-04-24 05:37:28 +00:00
fixit-unrecoverable.cpp When we run into an error parsing or type-checking the left-hand side 2010-09-17 22:25:06 +00:00
fixit-vexing-parse.cpp Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its: 2012-01-12 23:53:29 +00:00
fixit.c Revert most of r145372 for now. Lookahead beyond the ';' in a function 2011-11-30 23:45:35 +00:00
fixit.cpp Extend the diagnostic for a ',' at the end of a declaration where a ';' was 2012-01-09 22:31:44 +00:00
no-macro-fixit.c Issue the 2nd fixit even if fix-it hint is supressed. 2011-04-13 22:18:37 +00:00
no-typo.c Introduce -f{no-}spell-checking options to enable/disable 2010-07-09 17:35:33 +00:00
typo-crash.cpp Catch placeholder types in DefaultLvalueConversion 2011-10-11 23:14:30 +00:00
typo-crash.m Fix a crash with ill-formed code within a method in an ill-formed 2010-02-04 23:42:48 +00:00
typo.c Modify how the -verify flag works. Currently, the verification string and 2011-12-15 00:38:15 +00:00
typo.cpp When adding boolean keywords for typo correction, add either "bool" or 2011-07-01 21:27:45 +00:00
typo.m Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00