summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt
Commit message (Collapse)AuthorAgeFilesLines
...
* ObjectiveC. Provide a property-dot syntax for fixitFariborz Jahanian2013-12-101-0/+23
| | | | | | | when selector in objc_bridge_related attribute names a property. // rdar://15517899 llvm-svn: 196984
* Objective-C. Provide fixit's for objc_bride_relatedFariborz Jahanian2013-12-101-0/+35
| | | | | | | attributed CF to ObjC type conversions. // rdar://15499111 llvm-svn: 196935
* Fix test to actually check the FixIt-applied codeAlp Toker2013-11-031-1/+1
| | | | | | | | r102230 added an 'echo' making this a no-op. Also fixes FAIL on native Windows with no shell/GnuWin32. llvm-svn: 193938
* Special case '%C' handling in ObjC format strings to handle integer literals ↵Ted Kremenek2013-10-152-7/+7
| | | | | | | | that can represent unicode characters Fixes <rdar://problem/13991617>. llvm-svn: 192673
* Fix a bug in the typo correction replacement location.Kaelyn Uhrain2013-09-261-0/+21
| | | | | | | | I noticed the wrong text was being replaced with the correction while working on expanding the "namespace-aware" typo correction to include classes. llvm-svn: 191450
* Teach typo correction to look inside of classes like it does namespaces.Kaelyn Uhrain2013-09-261-6/+6
| | | | | | | | | | | | | | | Unlike with namespaces, searching inside of classes requires also checking the access to correction candidates (i.e. don't suggest a correction to a private class member for a correction occurring outside that class and its methods or friends). Included is a small (one line) fix for a bug, that was uncovered while cleaning up the unit tests, where the decls from a TypoCorrection candidate were preserved in new TypoCorrection candidates that are derived (copied) from the old TypoCorrection--notably when creating a new candidate by changing the NestedNameSpecifier associated with the base idenitifer. llvm-svn: 191449
* Testcase I forgot to svn add in r191057.Richard Smith2013-09-201-0/+25
| | | | llvm-svn: 191067
* Unify handling of string literal arguments for attributes and add fixits.Benjamin Kramer2013-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | This fixes a couple of latent crashes for invalid attributes and also adds a fixit hint to turn identifiers into string literals if one was expected. It then proceeds recovery as if the identifier was a literal. Diagnostic locations are also changed to point at the literal instead of the attribute if the error concerns the argument. PR17175. For example: hidden.c:1:40: error: 'visibility' attribute requires a string extern int x __attribute__((visibility(hidden))); ^ " " hidden.c:2:29: error: visibility does not match previous declaration extern int x __attribute__((visibility("default"))); ^ hidden.c:1:29: note: previous attribute is here extern int x __attribute__((visibility(hidden))); ^ llvm-svn: 190699
* clang/test/FixIt/fixit-unicode-with-utf8-output.c: Remove XFAIL.NAKAMURA Takumi2013-09-111-1/+0
| | | | | | | | It'd be another issue that the terminal and stdout(including redirects) with utf8. This test XPASSed on Win32, at least on Lit. FYI, we don't use a triplet like "-win64" anywhere. llvm-svn: 190559
* Test for correct usage of columnWidth in clang fixit hints.Alexander Kornienko2013-09-112-3/+37
| | | | | | | | | | | | | | | | | Summary: This test only works on systems capable of outputting UTF-8 encoded text on the standard output (tested on linux and OS X, should XFAIL on windows, if I haven't messed up the XFAIL line). Reviewers: jordan_rose Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1607 llvm-svn: 190537
* Make the information about disabled ARCMT/Rewriter/StaticAnalyzer availableRoman Divacky2013-08-271-0/+2
| | | | | | | to lit and use this info to disable Analysis/FixIt/Rewriter/Analysis tests when those are not compiled into clang. llvm-svn: 189395
* Implement [class.friend]p11's special name lookup rules for friend declarationsRichard Smith2013-08-091-1/+1
| | | | | | | | of local classes. We were previously handling this by performing qualified lookup within a function declaration(!!); replace it with the proper scope lookup. llvm-svn: 188050
* A few small cleanups to r187504. Thanks to dblaikie for the assist.Kaelyn Uhrain2013-07-311-0/+12
| | | | llvm-svn: 187521
* Move the "->" to "." fixit from r186128 into a separate note sinceKaelyn Uhrain2013-07-151-12/+0
| | | | | | | | recovery is not attempted with the fixit. Also move the associated test case from FixIt/fixit.cpp to SemaCXX/member-expr.cpp since the fixit is no longer automatically applied. llvm-svn: 186342
* Provide a better diagnostic and a fixit for a '.' or '->' before the left parenKaelyn Uhrain2013-07-121-0/+14
| | | | | | | | of a function call. This fixes PR5898 and means we now have a better diagnostic here than GCC. llvm-svn: 186208
* Provide a fixit hint for changing '->' to '.' if there is no operator->Kaelyn Uhrain2013-07-111-0/+12
| | | | | | defined for a class. llvm-svn: 186128
* PR5066: If a declarator cannot have an identifier, and cannot possibly beRichard Smith2013-07-111-0/+5
| | | | | | | | | followed by an identifier, then diagnose an identifier as being a bogus part of the declarator instead of tripping over it. Improves diagnostics for cases like std::vector<const int *p> my_vec; llvm-svn: 186061
* Offer typo suggestions for 'using' declarations.Kaelyn Uhrain2013-07-101-0/+56
| | | | | | Patch courtesy of Luke Zarko <zarko@google.com> llvm-svn: 186019
* Attempt typo correction for function calls with the wrong number of arguments.Kaelyn Uhrain2013-07-081-0/+8
| | | | | | | | | | | | | | | Combined with typo correction's new ability to apply global/absolute nested name specifiers to possible corrections, cases such as in PR12287 where the desired function is being shadowed by a lexically closer function with the same name but a different number of parameters will now include a FixIt. On a side note, since the test for this change caused test/SemaCXX/typo-correction.cpp to exceed the typo correction limit for a single file, I've included a test case for exceeding the limit and added some comments to both the original and part two of typo-correction.cpp warning future editors of the files about the limit. llvm-svn: 185881
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-0412-13/+13
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Allow typo correction to try removing nested name specifiers.Kaelyn Uhrain2013-07-021-3/+2
| | | | | | | | | | | | | | | | | The removal is tried by retrying the failed lookup of a correction candidate with either the MemberContext or SS (CXXScopeSpecifier) or both set to NULL if they weren't already. If the candidate identifier is then looked up successfully, make a note in the candidate that the SourceRange should include any existing nested name specifier even if the candidate isn't adding a different one (i.e. the candidate has a NULL NestedNameSpecifier). Also tweak the diagnostic messages to differentiate between a suggestion that just replaces the identifer but leaves the existing nested name specifier intact and one that replaces the entire qualified identifier, in cases where the suggested replacement is unqualified. llvm-svn: 185487
* Look for corrections in enclosing namespaces that require a global ↵Kaelyn Uhrain2013-07-021-2/+3
| | | | | | | | | | | | | | NestedNameSpecifier. CorrectTypo will now see and consider those corrections that are effectively shadowed by other declarations in a closer context when resolved via an unqualified lookup. This involves adding any parent namespaces to the set of namespaces as fully-qualified name specifiers, and also adding potential corrections that passed name lookup but were rejected by the given CorrectionCandidateCallback into the set of failed corrections that should be tried with the set of namespace specifiers. llvm-svn: 185486
* Add the global namespace (the "::" namespace specifier) to the list ofKaelyn Uhrain2013-06-241-2/+6
| | | | | | namespaces to try for potential typo corrections. llvm-svn: 184762
* Objective-C [qoi]: privide typo correction for selectorsFariborz Jahanian2013-06-181-0/+1
| | | | | | | | in addition of receiver having static type, but also when receiver has dynamic type (of 'id' variety) as well as when receiver is of 'Class' type vareity. // rdar://7853549 llvm-svn: 184195
* Objective-C [qoi]: Provide fixit hint when message with typoFariborz Jahanian2013-06-171-0/+10
| | | | | | is sent to a receiver object. This is wip. // rdar://7853549 llvm-svn: 184086
* Unify return type checking for functions and ObjC methods. Move all theEli Friedman2013-06-141-2/+10
| | | | | | | | random checks for ObjC object return types to SemaType.cpp. Fixes issue with ObjC method type checking reported on cfe-dev. llvm-svn: 184006
* Add -Wdeprecated warnings and fixits for things deprecated in C++11:Richard Smith2013-06-131-0/+5
| | | | | | | | | - 'register' storage class - dynamic exception specifications Only the former check is enabled by default for now (the latter might be quite noisy). llvm-svn: 183881
* Objective-C [qoi]: Issue better warning when nsstring literal is missingFariborz Jahanian2013-06-101-4/+4
| | | | | | the '@'. PR16287 and // rdar://14106083 llvm-svn: 183713
* Handle Unicode characters in fix-it replacement strings.Jordan Rose2013-06-071-0/+20
| | | | | | Patch by Sukolsak Sakshuwong! llvm-svn: 183535
* Objective-C: Provide fixit with suggested spelling correctionFariborz Jahanian2013-06-051-0/+30
| | | | | | for -Wundeclared-selector warnings. // rdar://14039037 llvm-svn: 183331
* The 'constexpr implies const' rule for non-static member functions is gone inRichard Smith2013-04-211-0/+12
| | | | | | | | | C++1y, so stop adding the 'const' there. Provide a compatibility warning for code relying on this in C++11, with a fix-it hint. Update our lazily-written tests to add the const, except for those ones which were testing our implementation of this rule. llvm-svn: 179969
* Objective-C arc [qui]. Don't issue the bridge castFariborz Jahanian2013-04-021-4/+4
| | | | | | | | warning when doing a __bride cast in non-arc mode (which has no retain count effect). // rdar://13514210 llvm-svn: 178592
* Objective-C: Provide fixit hints when warningFariborz Jahanian2013-04-021-0/+47
| | | | | | | | about 'isa' ivar being explicitely accessed when base is a user class object reference. // rdar://13503456 llvm-svn: 178562
* Objective-C: Provide fixit suggestions when class objectFariborz Jahanian2013-03-281-0/+19
| | | | | | | | is accessed via accessing 'isa' ivar to use object_getClass/object_setClass apis. // rdar://13503456 llvm-svn: 178282
* Fix testcase.Ted Kremenek2013-03-251-1/+1
| | | | llvm-svn: 177934
* For printf checking, handle nested typedefs for darwin-specific checking.Ted Kremenek2013-03-251-0/+8
| | | | | | Fixes <rdar://problem/13491605>. llvm-svn: 177931
* PR7256: Provide a fixit for incorrect destructor declarationsDavid Blaikie2013-03-201-0/+8
| | | | | | Fix by Ismail Pazarbasi (ismail.pazarbasi@gmail.com), review by Dmitri Gribenko. llvm-svn: 177546
* Fix warning text of my last patch.Fariborz Jahanian2013-02-281-1/+1
| | | | | | // rdar://13158394 llvm-svn: 176308
* objective-C: clang, following gcc, warns onFariborz Jahanian2013-02-281-1/+1
| | | | | | | | use of stand-alone protocol as type and uses id<proto>. Modify warning to say what compiler is doing. // rdar//13158394 llvm-svn: 176303
* objective-C arg: provide fixit support whenFariborz Jahanian2013-02-221-0/+19
| | | | | | | c++'s named cast need be replaced for bridge casting. // rdar://12788838 llvm-svn: 175923
* Revert "intmax_t is long long on Darwin, not long."Jordan Rose2013-02-201-23/+0
| | | | | | | | | 'long' and 'long long' are different for the purposes of mangling. This caused <rdar://problem/13254874>. This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c. llvm-svn: 175681
* PR15311: Finish implementation of the suggested resolution of core issue 1488,Richard Smith2013-02-201-1/+1
| | | | | | | | which allows grouping parens in an abstract-pack-declarator. This was already mostly implemented, but missed some cases. Add an ExtWarn for use of this extension until CWG ratifies it. llvm-svn: 175660
* intmax_t is long long on Darwin, not long.Jordan Rose2013-02-201-0/+23
| | | | | | <rdar://problem/11540697> llvm-svn: 175588
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-191-0/+17
| | | | | | | | attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575
* objc: Provide correct fixit instruction when two mismatchedFariborz Jahanian2013-02-011-0/+22
| | | | | | nsstringis are compared without. // rdar://12716301 llvm-svn: 174214
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-301-0/+12
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* Remove useless 'XPASS: *' from testsDmitri Gribenko2013-01-252-2/+1
| | | | llvm-svn: 173511
* This test actually passes, just add the missing expected-errorDmitri Gribenko2013-01-251-3/+3
| | | | llvm-svn: 173504
* Migrate test from grep to -fdiagnostics-parseable-fixitsDmitri Gribenko2013-01-251-1/+9
| | | | llvm-svn: 173496
* Test fix-it ranges for Unicode characters.Jordan Rose2013-01-241-1/+2
| | | | | | Also, remove stray -fdiagnostics-parseable-fixits from ucn-pp-identifier. llvm-svn: 173373
OpenPOWER on IntegriCloud