summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt
Commit message (Collapse)AuthorAgeFilesLines
* Disable this test until we figure out what madness it causesDouglas Gregor2010-10-261-0/+3
| | | | llvm-svn: 117416
* SignDouglas Gregor2010-10-261-1/+1
| | | | llvm-svn: 117400
* I hate this testDouglas Gregor2010-10-261-3/+3
| | | | llvm-svn: 117390
* Something is seriously wonky with this testDouglas Gregor2010-10-261-2/+6
| | | | llvm-svn: 117381
* Fix silly typoDouglas Gregor2010-10-261-1/+1
| | | | llvm-svn: 117373
* Teach typo correction not to return the same keyword that matches aDouglas Gregor2010-10-261-0/+9
| | | | | | | | typo. This can happen with context-sensitive keywords like "super", when typo correction didn't know that "super" wasn't permitted in this context. llvm-svn: 117372
* Minor tweak so that fixit-errors.c is never compiled; it crashes and pops up ↵Anders Carlsson2010-10-221-1/+1
| | | | | | a crash dialog on my system. llvm-svn: 117181
* Fix handling of property and ivar lookup in typo correction; the twoDouglas Gregor2010-10-202-6/+1
| | | | | | | kinds of lookup into Objective-C classes were tangled together, a situation that was compounded by automatically synthesized ivars. llvm-svn: 116907
* Disable this test while I track down the platform-specific issueDouglas Gregor2010-10-201-0/+3
| | | | llvm-svn: 116904
* Bah, incompetenceDouglas Gregor2010-10-201-0/+3
| | | | llvm-svn: 116898
* Eliminate another ordering dependency in typo correction. Re-enable typo.m, ↵Douglas Gregor2010-10-201-3/+0
| | | | | | which seems to be working properly. llvm-svn: 116894
* Disable this test again, which naturally fails on every platform except the ↵Douglas Gregor2010-10-151-0/+3
| | | | | | one I'm building with llvm-svn: 116642
* When performing typo correction, keep track of whether the last lookupDouglas Gregor2010-10-151-3/+0
| | | | | | | | | we did was an acceptable lookup. If it is, then we can re-use that lookup result. If it isn't, we have to perform the lookup again. This is almost surely the cause behind the mysterious typo.m failures on some builders; we were getting the wrong lookup results returned. llvm-svn: 116586
* Disable type.m while failures are investigated.Daniel Dunbar2010-10-151-0/+3
| | | | llvm-svn: 116577
* Make test more consistent.Daniel Dunbar2010-10-151-1/+1
| | | | llvm-svn: 116576
* When we encounter a '==' in a context expecting a '=', assume the user made ↵Argyrios Kyrtzidis2010-10-081-0/+12
| | | | | | | | | | | | | a typo: t.c:1:7: error: invalid '==' at end of declaration; did you mean '='? int x == 0; ^~ = Implements rdar://8488464. llvm-svn: 116035
* Better diagnostic for superfluous scope specifier inside a class definition ↵Francois Pichet2010-10-011-0/+5
| | | | | | | | | | | for member functions. + Fixit. Example: class A { void A::foo(); //warning: extra qualification on member 'foo' }; llvm-svn: 115347
* Update testDouglas Gregor2010-09-171-1/+2
| | | | llvm-svn: 114234
* When we run into an error parsing or type-checking the left-hand sideDouglas Gregor2010-09-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | of a binary expression, continue on and parse the right-hand side of the binary expression anyway, but don't call the semantic actions to type-check. Previously, we would see the error and then, effectively, skip tokens until the end of the statement. The result should be more useful recovery, both in the normal case (we'll actually see errors beyond the first one in a statement), but it also helps code completion do a much better job, because we do "real" code completion on the right-hand side of an invalid binary expression rather than completing with the recovery completion. For example, given x = p->y if there is no variable named "x", we can still complete after the p-> as a member expression. Along the recovery path, we would have completed after the "->" as if we were in an expression context, which is mostly useless. llvm-svn: 114225
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-161-1/+3
| | | | | | | | | | | | | | | | sends. These are far trickier than instance messages, because we typically have something like NSArray alloc] where it appears to be a declaration of a variable named "alloc" up until we see the ']' (or a ':'), and at that point we can't backtrace. So, we use a combination of syntactic and semantic disambiguation to treat this as a message send only when the type is an Objective-C type and it has the syntax of a class message send (which would otherwise be ill-formed). llvm-svn: 114057
* Handle bracket insertion for Objective-C class messages in a veryDouglas Gregor2010-09-151-0/+1
| | | | | | | | | | | narrow, almost useless case where we're inside a parenthesized expression, e.g., (NSArray alloc]) The solution to the general case still eludes me. llvm-svn: 114039
* Extend bracket insertion to message sends to "super", e.g.,Douglas Gregor2010-09-151-0/+14
| | | | | | | | super method:arg] will now recover nicely and insert the '[' before 'super'. llvm-svn: 113971
* Extend bracket insertion to handle nullary selectors, e.g.Douglas Gregor2010-09-151-0/+2
| | | | | | a getFoo] llvm-svn: 113969
* Implement bracket insertion for Objective-C instance message sends asDouglas Gregor2010-09-151-0/+19
| | | | | | | | | | | | | | | | | | | | | | | part of parser recovery. For example, given: a method1:arg]; we detect after parsing the expression "a" that we have the start of a message send expression. We pretend we've seen a '[' prior to the a, then parse the remainder as a message send. We'll then give a diagnostic+fix-it such as: fixit-objc-message.m:17:3: error: missing '[' at start of message send expression a method1:arg]; ^ [ The algorithm here is very simple, and always assumes that the open bracket goes at the beginning of the message send. It also only works for non-super instance message sends at this time. llvm-svn: 113968
* add a fixit when 'main' does ot return 'int'; review welcomeGabor Greif2010-09-081-0/+6
| | | | llvm-svn: 113324
* Improve recovery when there is a stray ']' or ')' before the ';' atDouglas Gregor2010-09-071-14/+18
| | | | | | the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
* Improve recovery when a comma is missing between enumerators in anDouglas Gregor2010-09-071-0/+7
| | | | | | enumeration definition. Fixes <rdar://problem/7159693>. llvm-svn: 113201
* Improve diagnostic and recovery when missing a comma between base orDouglas Gregor2010-09-071-0/+9
| | | | | | member initializers in a C++ constructor. Fixes <rdar://problem/7796492>. llvm-svn: 113199
* When complaining about a duplicate declspec, provide a Fix-It thatDouglas Gregor2010-08-231-0/+3
| | | | | | | removes the copy. Patch from Eelis van der Weegen, tweaked/updated by me. llvm-svn: 111807
* Introduce -f{no-}spell-checking options to enable/disableDouglas Gregor2010-07-091-0/+6
| | | | | | | spell-checking. By default, spell-checking is enabled for Clang (obviously) but disabled in CIndex for performance reasons. llvm-svn: 107992
* Fix broken testcaseDouglas Gregor2010-06-291-2/+2
| | | | llvm-svn: 107194
* Typo correction for namespace alias definitionsDouglas Gregor2010-06-291-2/+5
| | | | llvm-svn: 107191
* Allow a using directive to refer to the implicitly-defined namespaceDouglas Gregor2010-06-291-1/+6
| | | | | | | | "std", with a warning, to improve GCC compatibility. Fixes PR7517. As a drive-by, add typo correction for using directives. llvm-svn: 107172
* Tweak test for non-64-bit DarwinDouglas Gregor2010-05-311-4/+6
| | | | llvm-svn: 105222
* When we see the a '[' in a postfix expression in Objective-C, performDouglas Gregor2010-05-311-1/+7
| | | | | | | | | | | | | | | | | | | a simple, quick check to determine whether the expression starting with '[' can only be an Objective-C message send. If so, don't parse it as an array subscript expression. This improves recovery for, e.g., [a method1] [a method2] so that we now produce t.m:10:13: error: expected ';' after expression [a method] ^ instead of some mess about expecting ']'. llvm-svn: 105221
* Fix typo test caseDouglas Gregor2010-05-181-1/+1
| | | | llvm-svn: 104027
* Give a slight edge to the context-sensitive keyword 'super' overDouglas Gregor2010-05-181-4/+2
| | | | | | | | | non-function-local declarations with names similar to what the user typed. For example, this allows us to correct 'supper' to 'super' in an Objective-C message send, even though the C function 'isupper' has the same edit distance. llvm-svn: 104023
* Tweak typo-correction logic a bit regarding "super", so that weDouglas Gregor2010-05-181-1/+16
| | | | | | | | | consider "super" as a candidate whenever we're parsing an expression within an Objective-C method in an interface that has a superclass. At some point, we'd like to give "super" a little edge over non-local names; that will come later. llvm-svn: 104022
* Clean up test case and remove XFAIL. This test can now distinguish betweenTed Kremenek2010-05-171-21/+16
| | | | | | | cases where Clang can suggest and fix and suggest and not auto-fix (because of current limitations). llvm-svn: 103987
* Teach clang -fixit to modify files in-place, or -fixit=suffix to create newNick Lewycky2010-04-2414-28/+51
| | | | | | files with the additional suffix in the middle. llvm-svn: 102230
* fix the ?: fixit that ted added to recover properly.Chris Lattner2010-04-201-3/+3
| | | | llvm-svn: 101943
* When searching for code-completion and typo-correction candidates,Douglas Gregor2010-04-191-0/+34
| | | | | | | | look from an Objective-C class or category to its implementation, to pick up synthesized ivars. Fixes a problem reported by David Chisnall. llvm-svn: 101792
* Teach -fixit to modify all of its inputs instead of just the main file, unlessNick Lewycky2010-04-153-0/+3
| | | | | | -fixit-at specified a particular fixit to fix, or the -o flag was used. llvm-svn: 101359
* Thread a Scope pointer into BuildRecoveryCallExpr to help typoDouglas Gregor2010-04-141-0/+9
| | | | | | | correction find names when a call failed. Fixes <rdar://problem/7853795>. llvm-svn: 101278
* Teach typo correction about various language keywords. We can'tDouglas Gregor2010-04-143-0/+38
| | | | | | | | | | | | | generally recover from typos in keywords (since we would effectively have to mangle the token stream). However, there are still benefits to typo-correcting with keywords: - We don't make stupid suggestions when the user typed something that is similar to a keyword. - We can suggest the keyword in a diagnostic (did you mean "static_cast"?), even if we can't recover and therefore don't have a fix-it. llvm-svn: 101274
* Implement typo correction for Objective-C message sends when theDouglas Gregor2010-04-141-3/+2
| | | | | | | | | | | | | | | | | | | | | receiver is a mis-typed class name. Previously, we would give a non-specific typo-correction diagnostic from the expression-parsing code, but there was no fix-it because it was too late to recover. Now, we give a nice diagnostic honk.m:6:4: error: unknown receiver 'Hnk'; did you mean 'Honk'? [Hnk method]; ^~~ Honk honk.m:1:1: note: 'Honk' declared here @interface Honk ^ which includes a fix-it. We still need to recover better from mis-typing "super". llvm-svn: 101211
* Add fixit hint for missing ':' in ternary expressions.Ted Kremenek2010-04-121-0/+5
| | | | llvm-svn: 101073
* Remove fixit for string literal comparison. Telling the user to use ↵Ted Kremenek2010-04-091-6/+0
| | | | | | | | | 'strcmp' is bad, and we don't have enough information to tell them how to use 'strncmp'. Instead, change the diagnostic to indicate they should use 'strncmp'. llvm-svn: 100890
* Turn access control on by default in -cc1.John McCall2010-04-091-0/+1
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Improve diagnostics like "initializing <type> from an expression ofDouglas Gregor2010-04-091-1/+1
| | | | | | | type..." with "initializing <type> with an expression of type...", which reads better. Thanks to John for the improved wording. llvm-svn: 100873
OpenPOWER on IntegriCloud