summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt
Commit message (Collapse)AuthorAgeFilesLines
* Revert r218925 - "Patch to warn if 'override' is missing"Alexander Potapenko2014-10-032-35/+2
| | | | | | | | | | | | | | | | | | | | This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror. Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio: ================================================================ [ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20: In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19: /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ ================================================================ llvm-svn: 218969
* Patch to warn if 'override' is missingFariborz Jahanian2014-10-022-2/+35
| | | | | | | | | | | | for an overriding method if class has at least one 'override' specified on one of its methods. Reviewed by Doug Gregor. rdar://18295240 (I have already checked in all llvm files with missing 'override' methods and Bob Wilson has fixed a TableGen of FastISel so no warnings are expected from build of llvm after this patch. I have already verified this). llvm-svn: 218925
* Suggest fix-it for missing '{' after base-clauseIsmail Pazarbasi2014-09-251-1/+35
| | | | llvm-svn: 218468
* Add error, recovery and fixit for "~A::A() {...}".Richard Smith2014-09-061-0/+7
| | | | llvm-svn: 217302
* Objective-C [qoi]. Provide fix-it hint when sendingFariborz Jahanian2014-08-191-0/+30
| | | | | | class method to an object receiver. rdar://16263395 llvm-svn: 216038
* C++1y is now C++14!Aaron Ballman2014-08-191-1/+1
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Objective-C [qoi]. Patch to not do Fix-It for fixingFariborz Jahanian2014-08-121-0/+15
| | | | | | | | | a messaging expression except in the simple case of a unary selector. We cannot reliably provide such a fixit due to numerous reasons where a matching selector could not be found. rdar://15756038 llvm-svn: 215480
* Objective-C [qoi]. Issue warning and fixit if property-dot syntaxFariborz Jahanian2014-08-081-0/+31
| | | | | | | use mis-cased property name (which is currently accepted silently due to the way property setters are named). rdar://17911746 llvm-svn: 215250
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-2/+0
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* Objective-C ARC. Provide diagnostic and fix-it Fariborz Jahanian2014-06-261-0/+43
| | | | | | | | | when casting a retainable object to a objc_bridge_related CF type with the suggestion of applying the method specified in the bridging attribute to the object. // rdar://15932435 llvm-svn: 211807
* Objective-C. When we use @selector(save:), etc. there may be more Fariborz Jahanian2014-06-241-0/+26
| | | | | | | | | | | | | than one method with mismatched type of same selector name. clang issues a warning to point this out since it may cause undefined behavior. There are cases though that some APIs don't care about user methods and such warnings are perceived as noise. This patch allows users to add paren delimiters around selector name to turn off such warnings. So, @selector((save:)) will turn off the warning. It also provides 'fixit' so user knows what to do. // rdar://16458579 llvm-svn: 211611
* [C++1z] Implement N4051: 'typename' is permitted instead of 'class' when ↵Richard Smith2014-06-161-1/+1
| | | | | | declaring a template template parameter. llvm-svn: 211031
* PR11306 - Variadic template fix-it suggestion. Recover from misplaced or ↵Nikola Smiljanic2014-06-061-0/+20
| | | | | | redundant ellipsis in parameter pack. llvm-svn: 210304
* Fix test on platforms where size_t is not 'unsigned long'.Benjamin Kramer2014-05-311-1/+1
| | | | llvm-svn: 209974
* Format strings: check against an enum's underlying type.Jordan Rose2014-05-312-7/+57
| | | | | | | | | | | | | This allows us to be more careful when dealing with enums whose fixed underlying type requires special handling in a format string, like NSInteger. A refinement of r163266 from a year and a half ago, which added the special handling for NSInteger and friends in the first place. <rdar://problem/16616623> llvm-svn: 209966
* Refactor all the checking for missing 'template<>'s when a declaration has aRichard Smith2014-04-171-1/+3
| | | | | | template-id after its scope specifier into a single place. llvm-svn: 206442
* PR19415: Converting 'constexpr' to 'const' in a non-static data member can failRichard Smith2014-04-141-1/+2
| | | | | | if the member is already 'const'. Don't assert in that case. llvm-svn: 206205
* Normalize line endingsDavid Majnemer2014-03-021-1/+1
| | | | | | | Some files had CRLF line terminators, some only had a mixture of CRLF and LF. Switch to LF. llvm-svn: 202659
* check-clang: Introduce the feature "utf8-capable-terminal".NAKAMURA Takumi2014-02-061-0/+1
| | | | | | | | | | clang/test/FixIt/fixit-unicode-with-utf8-output.c has begun complained since LLVM r200885. Although it is changes for StringRef, it brought LLVM_ON_WIN32 to Support/Locale.cpp. Before r200885, LLVM_ON_WIN32 was undefined in Locale.cpp! FIXME: We should consider i18n on win32. llvm-svn: 200909
* Apply the typo correction replacement location fix from r191450 to theKaelyn Uhrain2014-01-281-0/+15
| | | | | | | | case when correcting for too many arguments (r191450 had only fixed the problem for when there were too few arguments). Also fix the underlining for both cases. llvm-svn: 200268
* Objective-C. After providing a fix-it for aFariborz Jahanian2013-12-182-8/+8
| | | | | | | | cstring, converted to NSString, produce the matching AST for it. This also required some refactoring of the previous code. // rdar://14106083 llvm-svn: 197605
* Objective-C. Make diagnostics and fix-its consistent Fariborz Jahanian2013-12-172-4/+28
| | | | | | | | when diagnosing casting of a cstring literal to NSString in default and -fobjc-arc mode. // rdar://14106083 llvm-svn: 197515
* Add a test for -fno-diagnostics-fixit-infoDmitri Gribenko2013-12-171-0/+16
| | | | llvm-svn: 197450
* 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
OpenPOWER on IntegriCloud