summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt
Commit message (Collapse)AuthorAgeFilesLines
...
* Add */& mismatch fixit generation to the Sema::DiagnoseAssignmentResult().Anna Zaks2011-07-282-0/+33
| | | | llvm-svn: 136379
* Provide fixit for static use of objective-c typeFariborz Jahanian2011-07-261-0/+11
| | | | | | | in few more places and in each instance, fix up the type to the expected type. // rdar://9603056 llvm-svn: 136103
* objective-c: Provide a 'fixit' when class was usedFariborz Jahanian2011-07-251-0/+18
| | | | | | to declare a static object. // rdar://9603056 llvm-svn: 135970
* Add FixIt hint for missing 'id' type.Fariborz Jahanian2011-07-211-0/+24
| | | | | | // rdar://9615045 llvm-svn: 135685
* Addressing code review comments for commit 135509 - Add FixItHints in case a ↵Anna Zaks2011-07-211-2/+19
| | | | | | C++ function call is missing * or & operators on llvm-svn: 135643
* Add FixItHints in case a C++ function call is missing * or & operators on ↵Anna Zaks2011-07-191-0/+87
| | | | | | one/several of it's parameters (addresses http://llvm.org/PR5941). llvm-svn: 135509
* Add a hackaround to avoid the crash in PR10355. However, our recoveryDouglas Gregor2011-07-141-0/+11
| | | | | | | is still terrible here because typo correction is not behaving well in the presence of overloaded functions. llvm-svn: 135128
* When adding boolean keywords for typo correction, add either "bool" orDouglas Gregor2011-07-011-0/+6
| | | | | | | "_Bool" (depending on dialect), but not both, since they have the same edit distance from "Bool". llvm-svn: 134263
* Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor2011-06-281-0/+6
| | | | | | | | | | | | | | | vector<int> to std::vector<int> Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes PR5776/<rdar://problem/8652971>. Thanks Kaelyn! llvm-svn: 134007
* Provide fix-it for '.' <-> '->' for Objective-C ivar/property access.Fariborz Jahanian2011-06-281-0/+14
| | | | | | // rdar://7811841 llvm-svn: 133970
* Allow the fixit for missing ':' in the ?: ternary operator if it is pointingArgyrios Kyrtzidis2011-06-241-0/+5
| | | | | | at the start of a macro instantiation. llvm-svn: 133801
* Fixed test case asserts due to checkin of r130710.Chad Rosier2011-05-021-1/+1
| | | | llvm-svn: 130720
* Extend Sema::ClassifyName() to support C++, ironing out a few issuesDouglas Gregor2011-04-271-0/+9
| | | | | | | | | in the classification of template names and using declarations. We now properly typo-correct the leading identifiers in statements to types, templates, values, etc. As an added bonus, this reduces the number of lookups required for disambiguation. llvm-svn: 130288
* Fix testDouglas Gregor2011-04-271-2/+2
| | | | llvm-svn: 130285
* Improve diagnostics for typo correction via Sema::ClassifyName(), byDouglas Gregor2011-04-272-3/+4
| | | | | | | | looking at the context and the correction and using a custom diagnostic. Also, enable some Fix-It tests that were somewhat lamely disabled. llvm-svn: 130283
* Implement a new identifier-classification scheme where SemaDouglas Gregor2011-04-243-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performs name lookup for an identifier and resolves it to a type/expression/template/etc. in the same step. This scheme is intended to improve both performance (by reducing the number of redundant name lookups for a given identifier token) and error recovery (by giving Sema a chance to correct type names before the parser has decided that the identifier isn't a type name). For example, this allows us to properly typo-correct type names at the beginning of a statement: t.c:6:3: error: use of undeclared identifier 'integer'; did you mean 'Integer'? integer *i = 0; ^~~~~~~ Integer t.c:1:13: note: 'Integer' declared here typedef int Integer; ^ Previously, we wouldn't give a Fix-It because the typo correction occurred after the parser had checked whether "integer" was a type name (via Sema::getTypeName(), which isn't allowed to typo-correct) and therefore decided to parse "integer * i = 0" as an expression. By typo-correcting earlier, we typo-correct to the type name Integer and parse this as a declaration. Moreover, in this context, we can also typo-correct identifiers to keywords, e.g., t.c:7:3: error: use of undeclared identifier 'vid'; did you mean 'void'? vid *p = i; ^~~ void and recover appropriately. Note that this is very much a work-in-progress. The new Sema::ClassifyName is only used for expression-or-declaration disambiguation in C at the statement level. The next steps will be to make this work for the same disambiguation in C++ (where functional-style casts make some trouble), then push it further into the parser to eliminate more redundant name lookups. Fixes <rdar://problem/7963833> for C and starts us down the path of <rdar://problem/8172000>. llvm-svn: 130082
* Fixit suggestion for adding missing tag name should have a space after the ↵Argyrios Kyrtzidis2011-04-211-0/+6
| | | | | | tag name. Fixes rdar://9295072 llvm-svn: 129917
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-0/+3
| | | | llvm-svn: 129567
* Issue the 2nd fixit even if fix-it hint is supressed.Fariborz Jahanian2011-04-131-1/+2
| | | | | | // rdar://9091893 llvm-svn: 129481
* No fixit hint for builtin expressions which areFariborz Jahanian2011-04-131-0/+15
| | | | | | defined in a macro. // rdar://9091893 llvm-svn: 129465
* Improve recovery (error + fix-it) when parsing type dependent template name ↵Francois Pichet2011-03-271-0/+19
| | | | | | | | | | | without the "template" keyword. For example: typename C1<T>:: /*template*/ Iterator<0> pos; Also the error is downgraded to an ExtWarn in Microsoft mode. llvm-svn: 128387
* Provide Fixit warning when 'auto' is intended as storageFariborz Jahanian2011-02-221-0/+11
| | | | | | | specifier in legacy code. Patch is reviewed offline by Doug. // rdar://9036633. llvm-svn: 126261
* Remove the Fix-It for "main must return 'int'", which is not alwaysDouglas Gregor2011-02-191-5/+0
| | | | | | correct and is not worth fixing. Fixes PR8396. llvm-svn: 126035
* 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
OpenPOWER on IntegriCloud