summaryrefslogtreecommitdiff
path: root/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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196984 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Provide fixit's for objc_bride_relatedFariborz Jahanian2013-12-101-0/+35
| | | | | | | | attributed CF to ObjC type conversions. // rdar://15499111 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196935 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193938 91177308-0d34-0410-b5e6-96231b3b80d8
* 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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192673 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191450 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191449 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase I forgot to svn add in r191057.Richard Smith2013-09-201-0/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191067 91177308-0d34-0410-b5e6-96231b3b80d8
* 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))); ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190699 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190559 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190537 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189395 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188050 91177308-0d34-0410-b5e6-96231b3b80d8
* A few small cleanups to r187504. Thanks to dblaikie for the assist.Kaelyn Uhrain2013-07-311-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187521 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186342 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186208 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a fixit hint for changing '->' to '.' if there is no operator->Kaelyn Uhrain2013-07-111-0/+12
| | | | | | defined for a class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186128 91177308-0d34-0410-b5e6-96231b3b80d8
* 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; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186061 91177308-0d34-0410-b5e6-96231b3b80d8
* Offer typo suggestions for 'using' declarations.Kaelyn Uhrain2013-07-101-0/+56
| | | | | | Patch courtesy of Luke Zarko <zarko@google.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186019 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185881 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185486 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the global namespace (the "::" namespace specifier) to the list ofKaelyn Uhrain2013-06-241-2/+6
| | | | | | namespaces to try for potential typo corrections. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184762 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184195 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184086 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184006 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183881 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C [qoi]: Issue better warning when nsstring literal is missingFariborz Jahanian2013-06-101-4/+4
| | | | | | | the '@'. PR16287 and // rdar://14106083 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183713 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle Unicode characters in fix-it replacement strings.Jordan Rose2013-06-071-0/+20
| | | | | | Patch by Sukolsak Sakshuwong! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183535 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C: Provide fixit with suggested spelling correctionFariborz Jahanian2013-06-051-0/+30
| | | | | | | | for -Wundeclared-selector warnings. // rdar://14039037 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183331 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179969 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178592 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178562 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178282 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix testcase.Ted Kremenek2013-03-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177934 91177308-0d34-0410-b5e6-96231b3b80d8
* For printf checking, handle nested typedefs for darwin-specific checking.Ted Kremenek2013-03-251-0/+8
| | | | | | Fixes <rdar://problem/13491605>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177931 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177546 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warning text of my last patch.Fariborz Jahanian2013-02-281-1/+1
| | | | | | | // rdar://13158394 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176308 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176303 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-C arg: provide fixit support whenFariborz Jahanian2013-02-221-0/+19
| | | | | | | | c++'s named cast need be replaced for bridge casting. // rdar://12788838 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175923 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175681 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175660 91177308-0d34-0410-b5e6-96231b3b80d8
* intmax_t is long long on Darwin, not long.Jordan Rose2013-02-201-0/+23
| | | | | | <rdar://problem/11540697> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175588 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175575 91177308-0d34-0410-b5e6-96231b3b80d8
* objc: Provide correct fixit instruction when two mismatchedFariborz Jahanian2013-02-011-0/+22
| | | | | | | nsstringis are compared without. // rdar://12716301 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174214 91177308-0d34-0410-b5e6-96231b3b80d8
* 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)) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173873 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove useless 'XPASS: *' from testsDmitri Gribenko2013-01-252-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173511 91177308-0d34-0410-b5e6-96231b3b80d8
* This test actually passes, just add the missing expected-errorDmitri Gribenko2013-01-251-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173504 91177308-0d34-0410-b5e6-96231b3b80d8
* Migrate test from grep to -fdiagnostics-parseable-fixitsDmitri Gribenko2013-01-251-1/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173496 91177308-0d34-0410-b5e6-96231b3b80d8
* Test fix-it ranges for Unicode characters.Jordan Rose2013-01-241-1/+2
| | | | | | Also, remove stray -fdiagnostics-parseable-fixits from ucn-pp-identifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173373 91177308-0d34-0410-b5e6-96231b3b80d8