• Home
  • History
  • Annotate
  • only in /external/clang/test/FixIt/
History log of /external/clang/test/FixIt/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
ixit-cxx0x.cpp
ixit-multiple-selector-warnings.m
ixit-objc-bridge-related.m
ixit.cpp
ormat-darwin.m
ormat.m
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
ixit-cxx0x.cpp
ixit.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
ixit-include.h
ixit-objc-arc.m
ixit-objc-bridge-related-attr.m
ixit-objc-bridge-related-property.m
ixit-objc.m
ixit-unicode-with-utf8-output.c
o-diagnostics-fixit-info.c
ypo-location-bugs.cpp
3a50d847e098f36e3bf8bc14eea07a6cc35f7803 03-Nov-2013 Alp Toker <alp@nuanti.com> Fix test to actually check the FixIt-applied code

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
ixit-errors-1.c
656465d6743e24022b28f831f1fe249f69b8626e 15-Oct-2013 Ted Kremenek <kremenek@apple.com> Special case '%C' handling in ObjC format strings to handle integer literals 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
ormat.m
ormat.mm
e67ebbed3dfdd6950b1d56eab7cb66b9a209381b 26-Sep-2013 Kaelyn Uhrain <rikka@google.com> Fix a bug in the typo correction replacement location.

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
ypo-location-bugs.cpp
3d9559b91c00757b296354cc6ca93e899266c7d2 26-Sep-2013 Kaelyn Uhrain <rikka@google.com> Teach typo correction to look inside of classes like it does namespaces.

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
ypo-using.cpp
75bd9ed70cec21b4395d701d371356cfe3ec9aae 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Testcase I forgot to svn add in r191057.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191067 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-uninit.c
1a343e26c76bb09d95b12c3693b19718f4811005 13-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Unify handling of string literal arguments for attributes and add fixits.

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
ixit.c
4bb81d684a342ecbe8be44acd1fc08b8ac3b8eb8 12-Sep-2013 NAKAMURA Takumi <geek4civic@gmail.com> clang/test/FixIt/fixit-unicode-with-utf8-output.c: Remove XFAIL.

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
ixit-unicode-with-utf8-output.c
8524ed123989512b98ef57fe1c10fe727ea40ac2 11-Sep-2013 Alexander Kornienko <alexfh@google.com> Test for correct usage of columnWidth in clang fixit hints.

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
ixit-unicode-with-utf8-output.c
ixit-unicode.c
2450b82b7d110ac1a11ffde3be90b8255767381d 27-Aug-2013 Roman Divacky <rdivacky@freebsd.org> Make the information about disabled ARCMT/Rewriter/StaticAnalyzer available
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
it.local.cfg
4e9686b1f9947f1747b4f4316deb2087a7f56282 09-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement [class.friend]p11's special name lookup rules for friend declarations
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
ypo-crash.cpp
c14e6dda1e1287d3e0aeaa0e8f7bb2c9126f312c 31-Jul-2013 Kaelyn Uhrain <rikka@google.com> A few small cleanups to r187504. Thanks to dblaikie for the assist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187521 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
d4224347be04594788fc0f26dff7d2c2cc90851e 15-Jul-2013 Kaelyn Uhrain <rikka@google.com> Move the "->" to "." fixit from r186128 into a separate note since
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
ixit.cpp
6e9d86b31813edafb775c93e5b5595ebce1e71e1 12-Jul-2013 Kaelyn Uhrain <rikka@google.com> Provide a better diagnostic and a fixit for a '.' or '->' before the left paren
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
ixit.cpp
45c3ba76e90753006bdfeea884972ddd24cb3131 12-Jul-2013 Kaelyn Uhrain <rikka@google.com> Provide a fixit hint for changing '->' to '.' if there is no operator->
defined for a class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186128 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
a38253c3e7dbd2b5aadb0556845dc3848168b904 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR5066: If a declarator cannot have an identifier, and cannot possibly be
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
ixit.cpp
0daf1f4a0ff1cd6487c7040ac8f97eee48185536 10-Jul-2013 Kaelyn Uhrain <rikka@google.com> Offer typo suggestions for 'using' declarations.

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
ypo-using.cpp
6c4898b6ff23950cddca6948ef3fa0dd1848f6f1 09-Jul-2013 Kaelyn Uhrain <rikka@google.com> Attempt typo correction for function calls with the wrong number of arguments.

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
ypo.cpp
96e7813f08c6adf1d8657b0da86741b54e850fd7 04-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 'not' to commands that are expected to fail.

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
ridge-cast-in-arc.mm
ixit-autoreleasepool.m
ixit-cxx11-attributes.cpp
ixit-include.c
ixit-interface-as-param.m
ixit-objc-message-comma-separator.m
ixit-unicode.c
ixit-vexing-parse.cpp
ixit.cpp
essages.cpp
o-fixit.cpp
ypo.c
b2567ddad9a1142d7224e5363029d640e8f4f59d 03-Jul-2013 Kaelyn Uhrain <rikka@google.com> Allow typo correction to try removing nested name specifiers.

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
ypo.cpp
caa16dd469b6f7bfb5bce05afd8772f5d4196322 03-Jul-2013 Kaelyn Uhrain <rikka@google.com> Look for corrections in enclosing namespaces that require a global 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
ypo-crash.cpp
8d90b4ab994c48c4b6d53122282dc93ac722bfc7 24-Jun-2013 Kaelyn Uhrain <rikka@google.com> Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184762 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
419245e0719e1785e4eb3954ddaee122e921c738 18-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi]: privide typo correction for selectors
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
elector-fixit.m
d395e34ae7aeeeaf9a37a12bc0f6de87158c95c3 17-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi]: Provide fixit hint when message with typo
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
elector-fixit.m
ddb5a3926d715ab4354ca36117679e3f4d5d3e21 14-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Unify return type checking for functions and ObjC methods. Move all the
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
ixit-static-object-decl.m
79f4bb7aad1b7c53f8a3bc43d89de0efdef8286d 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -Wdeprecated warnings and fixits for things deprecated in C++11:
- '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
ixit-cxx0x.cpp
4017d7378b1544e6c43f0ad857e6c18c3957efe0 11-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi]: Issue better warning when nsstring literal is missing
the '@'. PR16287 and // rdar://14106083


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183713 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
1f13fbd0c5bac045aa7d6ae3e998758e9dfa3ce4 07-Jun-2013 Jordan Rose <jordan_rose@apple.com> Handle Unicode characters in fix-it replacement strings.

Patch by Sukolsak Sakshuwong!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183535 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
9464a08a743295d6aefaca1a751b5b4d371cf99c 05-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit with suggested spelling correction
for -Wundeclared-selector warnings. // rdar://14039037



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183331 91177308-0d34-0410-b5e6-96231b3b80d8
elector-fixit.m
840462670ba7a6bc26265a2306b35f2f0f01f51c 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> The 'constexpr implies const' rule for non-static member functions is gone in
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
ixit-cxx1y-compat.cpp
7b47adcbea945e31db3e96567e81f14048c7a300 03-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C arc [qui]. Don't issue the bridge cast
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
ridge-in-non-arc.m
0c70181854a95fca0e0d56dfa1203eb2216052ea 02-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit hints when warning
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
uto-isa-fixit.m
ec8deba768e7ba93ad9974763dc3902896924a3c 28-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit suggestions when class object
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
uto-isa-fixit.m
b27564e87575101d37ccfd2f9647f1274aeaa5cf 26-Mar-2013 Ted Kremenek <kremenek@apple.com> Fix testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177934 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
6edb029026d290f12393ed8389a3e1de596c77ec 25-Mar-2013 Ted Kremenek <kremenek@apple.com> For printf checking, handle nested typedefs for darwin-specific checking.

Fixes <rdar://problem/13491605>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177931 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
36771d910b049cc534841c48ced90772784af446 20-Mar-2013 David Blaikie <dblaikie@gmail.com> PR7256: Provide a fixit for incorrect destructor declarations

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
ixit.cpp
d1084f6dd10ec79d1618d957fd3174bd04096cb3 01-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Fix warning text of my last patch.
// rdar://13158394


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176308 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
ced0e6570a90e3e7ab09691fd7f04428f4e97977 28-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: clang, following gcc, warns on
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
ixit-objc.m
f799ae1afb897151a84a7170951e367d8307ae04 22-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C arg: provide fixit support when
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
ridge-cast-in-arc.mm
90a7820de7685cec75fcd47e98f0f9623c0f0477 20-Feb-2013 Jordan Rose <jordan_rose@apple.com> Revert "intmax_t is long long on Darwin, not long."

'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
ormat-darwin.m
30f2a74f882adcadb8060d914684f65a401d87ba 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15311: Finish implementation of the suggested resolution of core issue 1488,
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
ixit-cxx0x.cpp
a905c4fd256396b589013304d9793cc199b8a0c6 20-Feb-2013 Jordan Rose <jordan_rose@apple.com> intmax_t is long long on Darwin, not long.

<rdar://problem/11540697>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175588 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
053214013990ad8ec096dafc64aa7c0ad2b05bc0 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15300: Support C++11 attributes on base-specifiers. We don't support any such
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
ixit-cxx11-attributes.cpp
41f7b1a854362f7de5cb6d6b0c2964373dede51d 01-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objc: Provide correct fixit instruction when two mismatched
nsstringis are compared without. // rdar://12716301


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174214 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-nsstring-compare.m
1d87fbaeea4a9fbbd73b3a53641f59f1673098e5 30-Jan-2013 David Blaikie <dblaikie@gmail.com> Provide a fixit for constexpr non-static data members.

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
ixit-cxx0x.cpp
3d115cfd1b9c48155d478b1f2f14dba1b6ba9a91 25-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'XPASS: *' from tests


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173511 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit-errors-1.c
d08606817a3c8f36441247451c1c9a19abeebd5e 25-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> This test actually passes, just add the missing expected-error


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173504 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-errors.c
ff3e102bc9dbece2dac365abc9863bc98e49f424 25-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Migrate test from grep to -fdiagnostics-parseable-fixits


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173496 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.c
dcceacb7f0085346164ac1dfb13f6f559533376b 24-Jan-2013 Jordan Rose <jordan_rose@apple.com> Test fix-it ranges for Unicode characters.

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
ixit-unicode.c
c7629d941557f7179eb8fa8a2e2a74d749cbaf7c 24-Jan-2013 Jordan Rose <jordan_rose@apple.com> Handle universal character names and Unicode characters outside of literals.

This is a missing piece for C99 conformance.

This patch handles UCNs by adding a '\\' case to LexTokenInternal and
LexIdentifier -- if we see a backslash, we tentatively try to read in a UCN.
If the UCN is not syntactically well-formed, we fall back to the old
treatment: a backslash followed by an identifier beginning with 'u' (or 'U').

Because the spelling of an identifier with UCNs still has the UCN in it, we
need to convert that to UTF-8 in Preprocessor::LookUpIdentifierInfo.

Of course, valid code that does *not* use UCNs will see only a very minimal
performance hit (checks after each identifier for non-ASCII characters,
checks when converting raw_identifiers to identifiers that they do not
contain UCNs, and checks when getting the spelling of an identifier that it
does not contain a UCN).

This patch also adds basic support for actual UTF-8 in the source. This is
treated almost exactly the same as UCNs except that we consider stray
Unicode characters to be mistakes and offer a fixit to remove them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173369 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
cdbe1e0d85d7d32452dd1c52758d7bfaa1c0663b 17-Jan-2013 Jordan Rose <jordan_rose@apple.com> Format strings: don't ever convert %+d to %lu.

Presumably, if the printf format has the sign explicitly requested, the user
wants to treat the data as signed.

This is a fix-up for r172739, and also includes several test changes that
didn't make it into that commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172762 91177308-0d34-0410-b5e6-96231b3b80d8
ormat.m
242ae3d6805185fcb4fd45e96af5beba93e3532c 17-Jan-2013 Jordan Rose <jordan_rose@apple.com> Format strings: correct signedness if already correcting width (%d,%u).

It is valid to do this:
printf("%u", (int)x);

But if we see this:
printf("%lu", (int)x);

...our fixit should suggest %d, not %u.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172739 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
ormat.m
c8145bbab03caba4b7ef5540727487529c7effeb 17-Jan-2013 Jordan Rose <jordan_rose@apple.com> Convert test/FixIt/format-darwin.m to use relative line numbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172738 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
07fc1ba7553f2f5bf26984091197311decd9028e 07-Jan-2013 Michael Han <fragmentshaders@gmail.com> Add fixit hints for misplaced C++11 attributes around class specifiers.

Following r168626, in class declaration or definition, there are a combination of syntactic locations
where C++11 attributes could appear, and among those the only valid location permitted by standard is
between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to
move them to expected location and we recover by applying them to the class specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171757 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx11-attributes.cpp
5964df144c21c548b9963f2ca35e0fa852b2f6f7 20-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use some heuristics so that when a fixit removes a source range, we try
to also remove a trailing space if possible.

For example, removing '__bridge' from:

i = (__bridge I*)p;

should result in:

i = (I*)p;

not:

i = ( I*)p;

rdar://11314821

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170764 91177308-0d34-0410-b5e6-96231b3b80d8
ridge-in-non-arc.m
2cd3440369d9241173e994485ddf2589a50a7d80 05-Dec-2012 Jordan Rose <jordan_rose@apple.com> Format strings: offer a cast to 'unichar' for %C in Objective-C contexts.

For most cases where a conversion specifier doesn't match an argument,
we usually guess that the conversion specifier is wrong. However, if
the argument is an integer type and the specifier is %C, it's likely
the user really did mean to print the integer as a character.

(This is more common than %c because there is no way to specify a unichar
literal -- you have to write an integer literal, such as '0x2603',
and then cast it to unichar.)

This does not change the behavior of %S, since there are fewer cases
where printing a literal Unicode *string* is necessary, but this could
easily be changed in the future.

<rdar://problem/11982013>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169400 91177308-0d34-0410-b5e6-96231b3b80d8
ormat.m
ormat.mm
17ddc54b8b94c58286dec6f99ae1f9e12e30d297 05-Dec-2012 Jordan Rose <jordan_rose@apple.com> Format strings: add more expression types that don't need parens to cast.

No functionality change (the test change is a comment only, and the new
functionality can't be tested using the current test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169399 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
448ac3e6d1f10264cea86c89cc14c266ba2da4a2 05-Dec-2012 Jordan Rose <jordan_rose@apple.com> Format strings: a character literal should be printed with %c, not %d.

The type of a character literal is 'int' in C, but if the user writes a
character /as/ a literal, we should assume they meant it to be a
character and not a numeric value, and thus offer %c as a correction
rather than %d.

There's a special case for multi-character literals (like 'MooV'), which
have implementation-defined value and usually cannot be printed with %c.
These still use %d as the suggestion.

In C++, the type of a character literal is 'char', and so this problem
doesn't exist.

<rdar://problem/12282316>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169398 91177308-0d34-0410-b5e6-96231b3b80d8
ormat.m
ff7be48165548c9c01492010609d166973607068 05-Dec-2012 Jordan Rose <jordan_rose@apple.com> Format strings: the correct conversion for 'char' is %c, not %d or %hhd.

We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169397 91177308-0d34-0410-b5e6-96231b3b80d8
ormat.m
35a2b798efd61fec425553f387d76be9c522f184 14-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Fix an assertion failure printing the unused-label fixit in files using CRLF line endings. <rdar://problem/12639047>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167900 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-newline-style.c
aa9a8ce5d31975900c7243b1508f5111baddacbe 20-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1473: Do not require a space between operator"" and the ud-suffix in a
literal-operator-id.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166373 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
6952c018318a8ce57e336d7ed2a4819a98182fa2 12-Oct-2012 David Blaikie <dblaikie@gmail.com> Fix typo correction of one qualified name to another.

When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.

This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).

Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165817 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
abeadfb11fde148f15c2fd67015e8163609d5b68 12-Oct-2012 David Blaikie <dblaikie@gmail.com> Provide a fixit when taking the address of an unqualified member function.

This only applies if the type has a name. (we could potentially do something
crazy with decltype in C++11 to qualify members of unnamed types but that
seems excessive)

It might be nice to also suggest a fixit for "&this->i", "&foo->i",
and "&foo.i" but those expressions produce 'bound' member functions that have
a different AST representation & make error recovery a little trickier. Left
as future work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165763 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
o-fixit.cpp
3f001ff471aec590a65a383a25367a4e1c82f5a3 03-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could
create retain cycles. Provide fixit. // rdar://11194874


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165133 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-missing-self-in-block.m
da313592441db36cf4b06be97c4bcc238ee6fa9c 27-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Per discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164743 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-include.c
59ed9e40bbb6d0b8f8cd194e059624e954b0eae7 25-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: remove use of 'ivar' in favor of
'instance variable' in text of all diagnostics
for objective-C: // rdar://12352442


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164559 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
4b0824229b96d024a96f3c7dd75ab70652c05c5b 18-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> If a comma operator is followed by a token which unambiguously indicates the
start of a statement or the end of a compound-statement, diagnose the comma as
a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and
minor refactoring by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164085 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
75379455fc88ca1f021e55ffe1cab3a9c2b2a37a 13-Sep-2012 Douglas Gregor <dgregor@apple.com> Promote the warning about extra qualification on a declaration from a
warning to an error. C++ bans it, and both GCC and EDG diagnose it as
an error. Microsoft allows it, so we still warn in Microsoft
mode. Fixes <rdar://problem/11135644>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163831 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
670941c28c0683ecc251dafdf093a71629625dc9 13-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.

<rdar://problem/12061922>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163772 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
275b6f52c7bcafc1f3cf291813b5c60ee776965a 13-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).

These will warn under -Wformat-non-iso, and will still be rejected
outright on other platforms.

<rdar://problem/12061922>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163771 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
ec08735e1b6a51c11533311b774bf6336c0a5d63 06-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.

These types are defined differently on 32-bit and 64-bit platforms, and
trying to offer a fixit for one platform would only mess up the format
string for the other. The Apple-recommended solution is to cast to a type
that is known to be large enough and always use that to print the value.

This should only have an impact on compile time if the format string is
incorrect; in cases where the format string matches the definition on the
current platform, no warning will be emitted.

<rdar://problem/9135072&12164284>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163266 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-darwin.m
b9c6261d02f688d0a9a36b736ad5956fbc737854 30-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160998 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-vexing-parse.cpp
bbe0175255d4da42cd99d93ca1e60c8eabcb4b9a 20-Jul-2012 Jordan Rose <jordan_rose@apple.com> Re-apply r160319 "Don't crash when emitting fixits following Unicode chars"

This time, make sure we don't try to print fixits with newline characters,
since they don't have a valid column width, and they don't look good anyway.

PR13417 (and originally <rdar://problem/11877454>)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160561 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
43972898614d91c00982f10cdf7f2bfb4a9f6275 20-Jul-2012 Nico Weber <nicolasweber@gmx.de> Revert r160319, it caused PR13417. Add a test for PR13417.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160542 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
0ccd98dff05616696f78572c46bf055dc244a605 20-Jul-2012 Chandler Carruth <chandlerc@gmail.com> Remove dos line endings. Please remember to configure your windows SVN
clients to default text files to 'eol-native'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160534 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-include.c
a52f5a3ee2156849b3b91255c360b9f0bb1ebd51 18-Jul-2012 Aaron Ballman <aaron@aaronballman.com> Adding a fixit for includes that cannot be found with angle brackets, but can be found with quoted strings instead. Implements PR13201.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160406 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-include.c
ixit-include.h
8d872ca7f10bb70d0757b894af79641679262bba 17-Jul-2012 Jordan Rose <jordan_rose@apple.com> Now that -Wobjc-literal-compare is a warning, put the fixit on a note.

Recovering as if the user had actually called -isEqual: is a bit too far from
the semantics of the program as written, /even though/ it's probably what they
intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160377 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-literals.m
b04a45720ba0cbc4bdb08aebceefa184e22f8a93 17-Jul-2012 Jordan Rose <jordan_rose@apple.com> Weaken Unicode fixit test to work even if the character is printed escaped.

This should fix the failure on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160324 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
ee07db7d91906d7ce371c972048e318901587933 16-Jul-2012 Ted Kremenek <kremenek@apple.com> This test appears to fail on win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160322 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
6f977c3e7918f9a668164f3ce27f1baa9557eb82 16-Jul-2012 Jordan Rose <jordan_rose@apple.com> Don't crash when emitting fixits following Unicode characters.

This code is very sensitive to the difference between "columns" as printed
and "bytes" (SourceManager columns). All variables are now named explicitly
and our assumptions are (hopefully) documented as both comment and assertion.

Whether parseable fixits should use byte offsets or Unicode character counts
is pending discussion on the mailing list; currently the implementation uses
bytes (and has no problems on lines containing multibyte characters).
This has been added to the user manual.

<rdar://problem/11877454>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160319 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
c7bd9fbecd50c1fcdc1092e37023dbb8677d4eed 12-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Be lax about trailing whitespace when checking fixit formatting, this depends on locale settings.

If a non-unicode locale is used, the unicode character is escaped and any
byte that is in the escaped representation but not the semicolon will
become whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160113 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
af082c3b163397c040c3a98c7a5f09ee2a0badef 12-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> PR13312: Don't crash when printing a fixit that ends in a unicode character.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160112 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unicode.c
6749ae1dbcc9e45ade21b05c6542a6354903ad77 09-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: provide fixit hint for @autoreleasepool
and similar other keywords. // rdar://10723084


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159956 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-autoreleasepool.m
6deae7cc8de2fb7578ed244d064cd34af744aac5 09-Jul-2012 Jordan Rose <jordan_rose@apple.com> Downgrade the "direct comparison" error for ObjC literals to a warning.

Chris pointed out that while the comparison is certainly problematic
and does not have well-defined behavior, it isn't any worse than some
of the other abuses that we merely warn about and doesn't need to make
the compilation fail.

Revert the release notes change (r159766) now that this is just a new warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159939 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-literals.m
c9f351700721150a985f21844fbfec55b04e861d 25-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Extend the "expected ';' after struct" logic to also apply to enums, and to
struct and enum forward-declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159164 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.c
b26331b4ff419b22861b0823daf83bc8f22a6803 19-Jun-2012 David Blaikie <dblaikie@gmail.com> Enable -Wnull-conversion for non-integral target types (eg: double).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158744 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
19a2702042b7e3ee838cca458b35f607111a3897 18-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Extend the error recovery for a template-argument-list terminated by '>>' to
also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to
deal with cases where the token is followed by an adjacent '=', '==', '>=',
'>>=', or '>>>' token, where a naive fix-it would result in a differing token
stream on a re-lex.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158652 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
f5485125ae70644c76b64ed3ff8a1c5fda937a82 11-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Enable -Wunused-private-field with -Wunused.

It found a lot of cruft in LLVM that I removed last week and I couldn't find any
false positives. Time to give it more testing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158317 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
1fdda369d3b94dae227abda0a10522fb60647d35 09-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add a test for r158229 (overlapping fixits). This was PR10696!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158238 91177308-0d34-0410-b5e6-96231b3b80d8
essages.cpp
9f63a451b1b3e36c0c82fcfe78828182bb9a6fa0 08-Jun-2012 Jordan Rose <jordan_rose@apple.com> Disallow using ObjC literals in direct comparisons (== and friends).

Objective-C literals conceptually always create new objects, but may be
optimized by the compiler or runtime (constant folding, singletons, etc).
Comparing addresses of these objects is relying on this optimization
behavior, which is really an implementation detail.

In the case of == and !=, offer a fixit to a call to -isEqual:, if the
method is available. This fixit is directly on the error so that it is
automatically applied.

Most of the time, this is really a newbie mistake, hence the fixit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158230 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-literals.m
b7fe579968a2fad25d95514f96c6649aae519c81 08-Jun-2012 Kaelyn Uhrain <rikka@google.com> Teach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158178 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
033a9c0804f48119a03b73a2af42a04d4d0294ce 05-Jun-2012 Jordan Rose <jordan_rose@apple.com> Make suggestions for mismatched enum arguments to printf/scanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157962 91177308-0d34-0410-b5e6-96231b3b80d8
ormat.m
2a53189a5186557640789ccb88da521047062674 31-May-2012 Jordan Rose <jordan_rose@apple.com> Add a test for '%@' suggestion for classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157718 91177308-0d34-0410-b5e6-96231b3b80d8
ormat.m
153acdb7310b20a72e608cbb10946621f161eb70 30-May-2012 Jordan Rose <jordan_rose@apple.com> Suggest '%@' for Objective-C objects in ObjC format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157716 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-no-fixit.m
ormat.m
6d1de1b8663fe652903bda2927b885d1ec0f2613 29-May-2012 Fariborz Jahanian <fjahanian@apple.com> objc: position of 'fixit' was off by one.
This patch fixes it. // rdar://11488351


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157646 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-interface-as-param.m
18df0eba838c7609d10edcb845ca6f35698e822c 22-May-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: provide a useful 'fixit' suggestion when
errornously using commas to separate ObjC message arguments.
// rdar://11376372


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157216 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc-message-comma-separator.m
1de6a6cb485fb58b4fb100282bb3cf298eedacd9 09-May-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c. Fixes a 'fixit' where location of
'*' on objective-c class name was misplaced.
// rdar://11311333


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156517 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-interface-as-param.m
2c0abf4ae33ab2ba690ccae724b8d6f196e7cfda 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Add FixItHint for -Wnull-conversion to initialize with an appropriate literal.

Reviewed by Doug Gregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155839 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
392b3f5798a62fe038082df0a5e2244b08b917d8 27-Apr-2012 Kaelyn Uhrain <rikka@google.com> Imrpove the note text for when a non-type decl hides a tag type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155723 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
aec2ac67e7190bdb88abb1d427b82ae3284ea756 27-Apr-2012 Kaelyn Uhrain <rikka@google.com> Add note to help explain why a tag such as 'struct' is needed to refer
to a given type, when the reason is that there is a non-type decl with
the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155677 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
2b90f7637e846ea555dedac14e7f5065d85c5d3b 25-Apr-2012 Kaelyn Uhrain <rikka@google.com> Add an error message with fixit hint for changing '.' to '->'.

This is mainly for attempting to recover in cases where a class provides
a custom operator-> and a '.' was accidentally used instead of '->' when
accessing a member of the object returned by the current object's
operator->.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155580 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
1e77b65b4819bc7a809245b12bd00450b4924025 20-Apr-2012 Kaelyn Uhrain <rikka@google.com> Re-add the closing '}' for the namespace I accidentally deleted when
removing a (new) duplicate test whose only difference was the tag type
being an enum instead of a struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155165 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
434ed260eb28cacd1b87fc2429dfee66d61dfcf0 20-Apr-2012 Kaelyn Uhrain <rikka@google.com> In Parser::isCXXDeclarationSpecifier, consider a non-type identifier
followed by an identifier as declaration specificer (except for ObjC).
This allows e.g. an out-of-line C++ member function definitions to be
recognized as functions and not as variable declarations if the type
name for the first parameter is not recognized as a type--say, when there
is a function name shadowing an enum type name and the parameter is
missing the "enum" keyword needed to distinguish the two.

Note that returning TPResult::Error() instead of TPResult::True()
appears to have the same end result, while TPResult::Ambiguous()
results in a crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155163 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
d2008e2c80d6c9282044ec873a937a17a0f33579 07-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement support for null non-type template arguments for non-type
template parameters of pointer, pointer-to-member, or nullptr_t
type in C++11. Fixes PR9700 / <rdar://problem/11193097>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154219 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
b2f6820773aabff3c5c9e0dbb1cbbbda0d80c41f 06-Apr-2012 Patrick Beard <pcbeard@mac.com> Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154187 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-missing-method-return-type.m
ypo.m
673720d8cfbc8c9d08faec2817f1e1452e4ecc2e 06-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix diagnostic text for r154163.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154164 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.cpp
9df1b963a69dc85a271b3791267e994485e0bfe1 06-Apr-2012 David Blaikie <dblaikie@gmail.com> Restrict fixit for missing 'class' in template template parameters.

Based on Doug's feedback to r153887 this omits the FixIt if the following token
isn't syntactically valid for the context. (not a comma, '...', identifier,
'>', or '>>')

There's a bunch of work to handle the '>>' case, but it makes for a much more
pleasant diagnostic in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154163 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.cpp
o-fixit.cpp
a82354563ebf9ed03b32ff5405e312425e6c1cad 05-Apr-2012 David Blaikie <dblaikie@gmail.com> Improve & simplify diagnostic for missing 'class' in template template parameter.

Change suggested by Sebastian Redl on review feedback from r153887.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154102 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
6d858d96ea294baecdf3e7ad3f3c5395c00dec8e 03-Apr-2012 Kaelyn Uhrain <rikka@google.com> Replace the workaround from r153445 with a proper fix.

Infinite recursion was happening when DiagnoseInvalidRedeclaration
called ActOnFunctionDeclarator to check if a typo correction works when
the correction was just to the nested-name-specifier because the wrong
DeclContext was being passed in. Unlike a number of functions
surrounding typo correction, the DeclContext passed in for a function is
the context of the function name after applying any nested name
specifiers, not the lexical DeclContext where the
function+nested-name-specifier appears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153962 91177308-0d34-0410-b5e6-96231b3b80d8
ypo-crash.cpp
460ef136eb96b879f149c8703938a13c35b4bc68 02-Apr-2012 David Blaikie <dblaikie@gmail.com> Correct error recovery when missing 'class' in a template template parameter.

The diagnostic message correctly informs the user that they have omitted the
'class' keyword, but neither suggests this insertion as a fixit, nor attempts
to recover as if they had provided the keyword.

This fixes the recovery, adds the fixit, and adds a separate diagnostic and
corresponding replacement fixit for cases where the user wrote 'struct' or
'typename' instead of 'class' (suggested by Richard Smith as a possible common
mistake).

I'm not sure the diagnostic message for either the original or new cases feel
very Clang-esque, so I'm open to suggestions there. The fixit hints make it
fairly easy to see what's required, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153887 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
9988f28fe7a6c19239a7426fea1ab23f9a8aac9c 29-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Reject 'template<typename...Ts> void f(Ts ...(x));'. Add a special-case
diagnostic and a fix-it to explain to the user where the ellipsis is
supposed to go.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153622 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
0179868cce096101236261ff64eca30224b1f233 26-Mar-2012 Douglas Gregor <dgregor@apple.com> When diagnosing an invalid out-of-line redeclaration, don't permit
typo correction to introduce a nested-name-specifier; we aren't
prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153445 91177308-0d34-0410-b5e6-96231b3b80d8
ypo-crash.cpp
07b49a88df1bad9305696f360f46cbe3b722ba40 18-Mar-2012 David Blaikie <dblaikie@gmail.com> Use character literals for vexing initialization fixit hints.

Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly
for other char types (wide, 16, and 32). Add tests for all these, and since
this means testing such hints under C++0x, add tests for some untested C++0x
hint cases in the existing code, including suggesting nullptr for pointer
initialization.

This sets up the initialization helper to provide better type fidelity that
will be especially helpful for non-assignment cases (such as fixit-correcting
NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead
of the less informative foo(0)))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153008 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-vexing-parse-cxx0x.cpp
ixit-vexing-parse.cpp
33762775706e81c17ca774102ceda36049ecc593 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a couple of issues with literal-operator-id parsing, and provide recovery
for a few kinds of error. Specifically:

Since we're after translation phase 6, the "" token might be formed by multiple
source-level string literals. Checking the token width is not a correct way of
detecting empty string literals, due to escaped newlines. Diagnose and recover
from a missing space between "" and suffix, and from string literals other than
"", which are followed by a suffix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152348 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
2fb4ae36825ca3a0cbe7e845c5747062870066be 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix not
starting with an underscore is ill-formed.

Since this rule rejects programs that were using <inttypes.h>'s macros, recover
from this error by treating the ud-suffix as a separate preprocessing-token,
with a DefaultError ExtWarn. The approach of treating such cases as two tokens
is under discussion for standardization, but is in any case a conforming
extension and allows existing codebases to keep building while the committee
makes up its mind.

Reword the warning on the definition of literal operators not starting with
underscores (which are, strangely, legal) to more explicitly state that such
operators can't be called by literals. Remove the special-case diagnostic for
hexfloats, since it was both triggering in the wrong cases and incorrect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152287 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit-cxx11-compat.cpp
9ae3a3647388c42b91505b175c1c8d0055b637dd 08-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> improve on diagnostic when block captures uninitialized
block variable. // rdar://10817031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152273 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-recursive-block.c
a34194f035096dd8dce10574e3a186da968aa211 08-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> improve on diagnostic and provide a fixit hint when
an uninitialized block variable is being called inside the
block literal. // rdar://10817031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152271 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-recursive-block.c
b65e24a690482e239dbd7f292bed3e87f644f8f7 07-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Test fix-it added in r152198.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152199 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx11-compat.cpp
b3f7542a950ac0d585a7783e825cfe670e05c553 06-Mar-2012 Ted Kremenek <kremenek@apple.com> And libclang cursor/indexing support for new Objective-C NSArray/NSDictionary/NSNumber literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152138 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-literals.m
bab0d39dbc417c9ea093df66b8134fb85a95f843 29-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> Test for my last patch. // rdar://10267155.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151767 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-property.m
92dc03546ccfd417108c1fc74321091a82cbeeee 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Tests for the fixits which Doug added in r150727.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150777 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
85b29a4c862bb9f41d9739e5dab6436fe6d44ff8 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Reject continue/break statements within members of local functions nested within
loop and switch statements, by teaching Scope that a function scope never has
a continue/break parent for the purposes of control flow. Remove the hack in
block and lambda expressions which worked around this by pretending that such
expressions were continue/break scopes.

Remove Scope::ControlParent, since it's unused.

In passing, teach default statements to recover properly from a missing ';', and
add a fixit for same to both default and case labels (the latter already
recovered correctly).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150776 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
3ac109cd17151bb8ad3a40b0cbb0e1923cd6c4a0 10-Feb-2012 Douglas Gregor <dgregor@apple.com> Allow implicit capture of 'this' in a lambda even when the capture
default is '=', and reword the warning about explicitly capturing
'this' in such lambdas to indicate that only explicit capture is
banned.

Introduce Fix-Its for this and other "save the programmer from
themself" rules regarding what can be explicitly captured and what
must be implicitly captured.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150256 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
d37b360bf9f954af119c9805fdc79ab9d30e06c6 10-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11684, core issue 1417:

o Correct the handling of the restrictions on usage of cv-qualified and
ref-qualified function types.
o Fix a bug where such types were rejected in template type parameter default
arguments, due to such arguments not being treated as a template type arg
context.
o Remove the ExtWarn for usage of such types as template arguments; that was
a standard defect, not a GCC extension.
o Improve the wording and unify the code for diagnosing cv-qualifiers with the
code for diagnosing ref-qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150244 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
61d679ab2831b161c857cf3f974312fbd4ef1efd 26-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce 3 new fixit options:

-fixit-recompile
applies fixits and recompiles the result
-fixit-to-temporary
applies fixits to temporary files
-fix-only-warnings">,
applies fixits for warnings only, not errors

Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits
without touching the original sources.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149027 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-recompile.c
fcaf27e185695bdf755e202aeba9632e0a8ef3c6 19-Jan-2012 Richard Trieu <rtrieu@google.com> Extend the error of invalid token after declarations to include fixits for
!=, %=, ^=, &=, *=, -=, |=, /=, <<=, <=, >=, and >>= to =.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148499 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
d6c7c67313634b317a0d63c32be0511a121bb33d 18-Jan-2012 Richard Trieu <rtrieu@google.com> Change the error when a '+=' follows a declaration to suggest a fixit to '=' instead of just suggesting a ';'.

Old error:
plusequaldeclare1.cc:3:8: error: expected ';' at end of declaration
int x += 6;
^
;

New error:
plusequaldeclare1.cc:3:9: error: invalid '+=' at end of declaration; did you
mean '='?
int x += 6;
^~
=



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148433 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
7984de35644701c0d94336da7f2215d4c26d9f5b 13-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:

- If the declarator is at the start of a line, and the previous line contained
another declarator and ended with a comma, then that comma was probably a
typo for a semicolon:

int n = 0, m = 1, l = 2, // k = 5;
myImportantFunctionCall(); // oops!

- If removing the parentheses would correctly initialize the object, then
produce a note suggesting that fix.

- Otherwise, if there is a simple initializer we can suggest which performs
value-initialization, then provide a note suggesting a correction to that
initializer.

Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148072 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-vexing-parse.cpp
bdad7a2e21686296b78dac6190b78d11c996f6d7 10-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update C++11 scoped enumeration support to match the final proposal:
- reject definitions of enums within friend declarations
- require 'enum', not 'enum class', for non-declaring references to scoped
enumerations


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147824 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
1c94c16317c1a35c1549e022958188eea2567089 09-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Extend the diagnostic for a ',' at the end of a declaration where a ';' was
intended to cover C++ class definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147808 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.cpp
dd4b350143c26c030a482f091908a2e077503411 25-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix constexpr handling to allow 'extern constexpr' variable declarations. We no
longer have access to the source locations we need to produce the
'replace constexpr with const' fixits, so they're gone for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147273 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc 15-Dec-2011 Richard Trieu <rtrieu@google.com> Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:

// expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters

It will also match these other error messages:

candidate function
function has different number of parameters
number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.c
58196dc06ee27cd4150ef483123e1e3b2c772821 01-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Revert most of r145372 for now. Lookahead beyond the ';' in a function
declaration tickles a bug in the way we handle visibility pragmas.

The improvement to error recovery for template function definitions declared
with the 'typedef' specifier in r145372 is unrelated and not reverted here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145541 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.c
ixit.cpp
6e1fd33116c2977174f2df17ac8bad2a32659db8 29-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add fix-it to remove 'typedef' from function template definitions. Such a token
was probably meant to be 'typename', which we will have already suggested if it
is appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145395 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
874d253668f9ed183ca409cdff9d424925ee7800 29-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR10101: Recover better from a common copy-paste error: if a function
declaration at namespace scope is followed by a semicolon and an open-brace
(or in C++, a 'try', ':' or '='), then the error is probably a function
definition with a spurious ';', rather than a mysterious '{'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145372 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.c
ixit.cpp
98e13eac132c16466b75af3fd2365be09130e9d6 20-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Make the -verify bits in this test actually test something, and fix a few cases
where the test didn't work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142563 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
0706df40064d4d7559b4304af79d519033414b84 19-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Improve the diagnostic when a comma ends up at the end of a declarator group
instead of a semicolon (as sometimes happens during refactorings). When such a
comma is seen at the end of a line, and is followed by something which can't
possibly be a declarator (or even something which might be a plausible typo for
a declarator), suggest that a semicolon was intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142544 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit.c
ixit.cpp
43f5103f8051bbac19022e6edaf7d9138b0f3c0f 19-Oct-2011 Douglas Gregor <dgregor@apple.com> Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142478 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
762bb9d0ad20320b9f97a841dce57ba5e8e48b07 14-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
6dbba4fc128e2e2f5b26be996392bd32c0707f13 12-Oct-2011 John McCall <rjmccall@apple.com> Catch placeholder types in DefaultLvalueConversion
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141738 91177308-0d34-0410-b5e6-96231b3b80d8
ypo-crash.cpp
856ebfb6357042d46052ccb39c1fbb490718320e 07-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Remove FIXME obsoleted by change r141279 for PR11067.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141351 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
d1e40d5389a4382cbebc97d54792f41ee0414af4 02-Oct-2011 John McCall <rjmccall@apple.com> Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
947be1941e9a1d4233116f51a45799d3904d4231 30-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Mark the ExtWarn for in-class initialization of static const float members as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140820 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
c6d990a767150b02337de1136fdb55ccf349f4d1 29-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: semantic checking for constexpr variables.

We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140801 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
2315318436b3e94d54c220c3b8986e8002394a43 06-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so:

RUN: foo
RUN: bar || true

is equivalent to:

RUN: foo && bar || true

which is equivalent to:

RUN: (foo && bar) || true

This resulted in several of the fixit tests not really testing anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139132 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
ixit-errors.c
ixit-function-call.cpp
ixit-missing-method-return-type.m
ixit-objc-message.m
ixit-static-object-decl.m
ixit.c
ixit.cpp
f0c1d8f804e7854bedf3f241409185951ee67866 03-Aug-2011 Kaelyn Uhrain <rikka@google.com> Improve overloaded function handling in the typo correction code.

Change TypoCorrection to store a set of NamedDecls instead of a single
NamedDecl. Also add initial support for performing function overload
resolution to Sema::DiagnoseEmptyLookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136807 91177308-0d34-0410-b5e6-96231b3b80d8
ypo-crash.cpp
f78c4e57122dad4430329135b966dfc241a6425b 30-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce a Fix-It for the "missing sentinel" warning, adding an
appropriate sentinel at the end of the argument list. Also, put the
sentinel warnings under -Wsentinel. Fixes <rdar://problem/8764236>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136566 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
d5612a235fdd5df145c485c6ac489fcfbf7120d3 28-Jul-2011 Anna Zaks <ganna@apple.com> Add a fixit for removal of unused label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136389 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
1d05d424cb2be0e3f369ec27d8fb8be20e9ba5ae 28-Jul-2011 Anna Zaks <ganna@apple.com> Another test case for the &/* mismatch fixit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136380 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-function-call.cpp
6722155dfe056e2c3dfbacbcaffae04dea0c2be0 28-Jul-2011 Anna Zaks <ganna@apple.com> Add */& mismatch fixit generation to the Sema::DiagnoseAssignmentResult().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136379 91177308-0d34-0410-b5e6-96231b3b80d8
ereference-addressof.c
ixit.cpp
8eaefdc6aed76e26619caffed030a57438280897 26-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Provide fixit for static use of objective-c type
in few more places and in each instance, fix up
the type to the expected type. // rdar://9603056


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136103 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-static-object-decl.m
dcf1011876d8a472aeb05617c1a84c3d74fbd7ce 25-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Provide a 'fixit' when class was used
to declare a static object. // rdar://9603056


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135970 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-static-object-decl.m
feb4fa165c5e8c40ffc8b1b655cc3c8071862b20 21-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Add FixIt hint for missing 'id' type.
// rdar://9615045


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135685 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-missing-method-return-type.m
ffe9edd45f26873d58e7ddf79d403dd8072b748b 21-Jul-2011 Anna Zaks <ganna@apple.com> Addressing code review comments for commit 135509 - Add FixItHints in case a C++ function call is missing * or & operators on

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135643 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-function-call.cpp
b89fe6b04c5b8a2d080c1c5605b72f809fc9ee68 19-Jul-2011 Anna Zaks <ganna@apple.com> Add FixItHints in case a C++ function call is missing * or & operators on one/several of it's parameters (addresses http://llvm.org/PR5941).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135509 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-function-call.cpp
3a348c86ffaebd3ba8bd9bbae342b6e9f5f62cd7 14-Jul-2011 Douglas Gregor <dgregor@apple.com> Add a hackaround to avoid the crash in PR10355. However, our recovery
is still terrible here because typo correction is not behaving well in
the presence of overloaded functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135128 91177308-0d34-0410-b5e6-96231b3b80d8
ypo-crash.cpp
07f4a06c402a2ccdd9eae7a3d710990b22040001 01-Jul-2011 Douglas Gregor <dgregor@apple.com> When adding boolean keywords for typo correction, add either "bool" or
"_Bool" (depending on dialect), but not both, since they have the same
edit distance from "Bool".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134263 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
d8bba9c15230d2b1b3893e272106aa79efc50251 28-Jun-2011 Douglas Gregor <dgregor@apple.com> Add support for C++ namespace-aware typo correction, e.g., correcting

vector<int>

to

std::vector<int>

Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes
PR5776/<rdar://problem/8652971>.

Thanks Kaelyn!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134007 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
6326e05fe8c2ff92b65b4759a91e45fad5ef886f 28-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Provide fix-it for '.' <-> '->' for Objective-C ivar/property access.
// rdar://7811841


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133970 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
b5303aa20e4eb26d53edde710f4a042650bea24d 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow the fixit for missing ':' in the ?: ternary operator if it is pointing
at the start of a macro instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133801 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
02a444dc8015347e5e5c60d5b11e8a1d6fdceaf3 02-May-2011 Chad Rosier <mcrosier@apple.com> Fixed test case asserts due to checkin of r130710.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130720 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
3b887354b1b667c97d070ddc67b5354353c4c07b 27-Apr-2011 Douglas Gregor <dgregor@apple.com> Extend Sema::ClassifyName() to support C++, ironing out a few issues
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130288 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
6add6fbc5997c42fb014969b68770b1b29aa318b 27-Apr-2011 Douglas Gregor <dgregor@apple.com> Fix test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130285 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
27766d2501259c7b12b1056e0c491a927b304e10 27-Apr-2011 Douglas Gregor <dgregor@apple.com> Improve diagnostics for typo correction via Sema::ClassifyName(), by
looking at the context and the correction and using a custom
diagnostic. Also, enable some Fix-It tests that were somewhat lamely
disabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130283 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.c
ypo.cpp
312eadb832cab4497a069409954500d8192b8f0d 24-Apr-2011 Douglas Gregor <dgregor@apple.com> Implement a new identifier-classification scheme where Sema
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>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130082 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unrecoverable.c
ypo.c
ypo.m
b8a9d3b8016c0b8cc58e8523de0f4766cf3fa6bf 21-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fixit suggestion for adding missing tag name should have a space after the tag name. Fixes rdar://9295072

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129917 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
162e1c1b487352434552147967c3dd296ebee2f7 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Support for C++11 (non-template) alias declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
6027461b6c4d1567a8d7533ad97ccf81bd2b9500 14-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Issue the 2nd fixit even if fix-it hint is supressed.
// rdar://9091893


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129481 91177308-0d34-0410-b5e6-96231b3b80d8
o-macro-fixit.c
81ab3cfcf2f312e82c51e58a1fce8e85e9fe59c3 13-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> No fixit hint for builtin expressions which are
defined in a macro. // rdar://9091893


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129465 91177308-0d34-0410-b5e6-96231b3b80d8
o-macro-fixit.c
4147d307086cf024a40a080e2bf379e9725f6f41 27-Mar-2011 Francois Pichet <pichet2000@gmail.com> Improve recovery (error + fix-it) when parsing type dependent template name without the "template" keyword.

For example:
typename C1<T>:: /*template*/ Iterator<0> pos;

Also the error is downgraded to an ExtWarn in Microsoft mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128387 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
12e3ecec906f65580059a9d8555849a272c2db81 23-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Provide Fixit warning when 'auto' is intended as storage
specifier in legacy code. Patch is reviewed offline by Doug.
// rdar://9036633.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126261 91177308-0d34-0410-b5e6-96231b3b80d8
uto-fixit.m
5f39f706afeb4d4a6f246db1e8cd2da0fb5b7f37 19-Feb-2011 Douglas Gregor <dgregor@apple.com> Remove the Fix-It for "main must return 'int'", which is not always
correct and is not worth fixing. Fixes PR8396.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126035 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
c37b736150db77ddfcfc0e5f1171c258a32d6ef7 27-Oct-2010 Douglas Gregor <dgregor@apple.com> Disable this test until we figure out what madness it causes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117416 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
9c13f5bc0e0ecdd9f00872fdc0b0ac48e01fec38 26-Oct-2010 Douglas Gregor <dgregor@apple.com> Sign

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117400 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
30af47fde154f04b3ac0c4cd9576e39e942689f8 26-Oct-2010 Douglas Gregor <dgregor@apple.com> I hate this test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117390 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
808bedfd8cf18146bde5a181862375f1b1d261af 26-Oct-2010 Douglas Gregor <dgregor@apple.com> Something is seriously wonky with this test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117381 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
bddf8ebd793c06fced4aad5a082882a997f7f0e8 26-Oct-2010 Douglas Gregor <dgregor@apple.com> Fix silly typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117373 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
53e4b55d2c534cfd59021ff18349ac58979ce43f 26-Oct-2010 Douglas Gregor <dgregor@apple.com> Teach typo correction not to return the same keyword that matches a
typo. This can happen with context-sensitive keywords like "super",
when typo correction didn't know that "super" wasn't permitted in this
context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117372 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
b164a19eb4b7f120a3ce8922587b7777ddbefde6 23-Oct-2010 Anders Carlsson <andersca@mac.com> Minor tweak so that fixit-errors.c is never compiled; it crashes and pops up a crash dialog on my system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117181 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-errors.c
9a632eaa0ee73e4db701a8df74e92909d1fa350e 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Fix handling of property and ivar lookup in typo correction; the two
kinds of lookup into Objective-C classes were tangled together, a
situation that was compounded by automatically synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116907 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
ypo.m
06ff47b0bbd6d311745010bf4d83ff394502ac0e 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Disable this test while I track down the platform-specific issue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116904 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
b4226ff0e47484c46afe7c32122db0b341aabb51 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Bah, incompetence

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116898 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
f98402d9e6ccef7052eb01de418fd740f5f5e02f 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Eliminate another ordering dependency in typo correction. Re-enable typo.m, which seems to be working properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116894 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
31df9be7a85615a6aaeaf8b0ce6721760d4efdcf 16-Oct-2010 Douglas Gregor <dgregor@apple.com> Disable this test again, which naturally fails on every platform except the one I'm building with

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116642 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
6eaac8b3e68177f56090ddb0fcfc8fbfd49150a6 15-Oct-2010 Douglas Gregor <dgregor@apple.com> When performing typo correction, keep track of whether the last lookup
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116586 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
8712930d4fbb4d97c872157df49bf66255bb583a 15-Oct-2010 Daniel Dunbar <daniel@zuster.org> Disable type.m while failures are investigated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116577 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
b63ff72252dfe20f6ec79d503278910aebde94fe 15-Oct-2010 Daniel Dunbar <daniel@zuster.org> Make test more consistent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116576 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
a6eb5f81d13bacac01faff70a947047725b4413f 08-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When we encounter a '==' in a context expecting a '=', assume the user made a typo:

t.c:1:7: error: invalid '==' at end of declaration; did you mean '='?
int x == 0;
^~
=

Implements rdar://8488464.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116035 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
c71d8eb6592ae3ef498fc57db3563d1dfae48dff 01-Oct-2010 Francois Pichet <pichet2000@gmail.com> Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.

Example:
class A {
void A::foo(); //warning: extra qualification on member 'foo'
};


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115347 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
837e738d91b2b79b676a7bcddd918e3f4a32bce1 18-Sep-2010 Douglas Gregor <dgregor@apple.com> Update test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114234 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
200b2921390bd75a659be3c77011e9a5548b7273 18-Sep-2010 Douglas Gregor <dgregor@apple.com> When we run into an error parsing or type-checking the left-hand side
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114225 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unrecoverable.cpp
9497a73ad0d54859edbf48beb93ebb19a7ae50c9 16-Sep-2010 Douglas Gregor <dgregor@apple.com> Implement automatic bracket insertion for Objective-C class message
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).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114057 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc-message.m
77328d1bb92c2c46bc3e4badc4b4b97c517903b7 16-Sep-2010 Douglas Gregor <dgregor@apple.com> Handle bracket insertion for Objective-C class messages in a very
narrow, almost useless case where we're inside a parenthesized
expression, e.g.,

(NSArray alloc])

The solution to the general case still eludes me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114039 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc-message.m
fa885c11e33ca1140e3cf376eb43cb70bbf96962 15-Sep-2010 Douglas Gregor <dgregor@apple.com> Extend bracket insertion to message sends to "super", e.g.,

super method:arg]

will now recover nicely and insert the '[' before 'super'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113971 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc-message.m
b65042da3aa4dc2f9fc1c606fa6817089fd86cd6 15-Sep-2010 Douglas Gregor <dgregor@apple.com> Extend bracket insertion to handle nullary selectors, e.g.

a getFoo]




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113969 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc-message.m
0fbda68b50ce17d7ad36ef7a5ed77518a5cd272e 15-Sep-2010 Douglas Gregor <dgregor@apple.com> Implement bracket insertion for Objective-C instance message sends as
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113968 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc-message.m
a4a301dc74dd4e7da1c35cbb3c1e03614482728b 08-Sep-2010 Gabor Greif <ggreif@gmail.com> add a fixit when 'main' does ot return 'int'; review welcome

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113324 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
9ba23b4ceacd77cd264501690a7a9e94184ef71b 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Improve recovery when there is a stray ']' or ')' before the ';' at
the end of a statement. Fixes <rdar://problem/6896493>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113202 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
751f6922376dfe9432795b65a3649179e4ef5cf5 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Improve recovery when a comma is missing between enumerators in an
enumeration definition. Fixes <rdar://problem/7159693>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113201 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
b1f6fa48960eae269a3931d1fc545ed468d9a4d2 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostic and recovery when missing a comma between base or
member initializers in a C++ constructor. Fixes <rdar://problem/7796492>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113199 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
ae2fb144fef905a860a49e8066fb28521447f7c9 23-Aug-2010 Douglas Gregor <dgregor@apple.com> When complaining about a duplicate declspec, provide a Fix-It that
removes the copy. Patch from Eelis van der Weegen, tweaked/updated by
me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111807 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
a0068fc64351db9c47916566e3b85ab733cd8d6d 09-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce -f{no-}spell-checking options to enable/disable
spell-checking. By default, spell-checking is enabled for Clang
(obviously) but disabled in CIndex for performance reasons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
o-typo.c
ed8407692d47833abddd31a8cf30bf560e771c9b 29-Jun-2010 Douglas Gregor <dgregor@apple.com> Fix broken testcase

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107194 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
0e8c4b9fac447c6c9849e3ef8beb1ef273ac0f97 29-Jun-2010 Douglas Gregor <dgregor@apple.com> Typo correction for namespace alias definitions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107191 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
6699220f73f11e471b5e5aa42eaf064afeaa079e 29-Jun-2010 Douglas Gregor <dgregor@apple.com> Allow a using directive to refer to the implicitly-defined namespace
"std", with a warning, to improve GCC compatibility. Fixes PR7517.

As a drive-by, add typo correction for using directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107172 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
de037c2bc288f9bbf5091a34f7d9f2dd98cd7df2 31-May-2010 Douglas Gregor <dgregor@apple.com> Tweak test for non-64-bit Darwin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105222 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
1b730e847ded503f2e615154035c083c4f94a067 31-May-2010 Douglas Gregor <dgregor@apple.com> When we see the a '[' in a postfix expression in Objective-C, perform
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 ']'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105221 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
a1d1c7555ce3fd86eb66ab3e651af54900bc5800 18-May-2010 Douglas Gregor <dgregor@apple.com> Fix typo test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104027 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
d0785ea6c4c37a7fa4fcd4840e6e036ffb44e13e 18-May-2010 Douglas Gregor <dgregor@apple.com> Give a slight edge to the context-sensitive keyword 'super' over
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104023 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
91f7ac7e20ba03b8cd711974e2611231077bbe81 18-May-2010 Douglas Gregor <dgregor@apple.com> Tweak typo-correction logic a bit regarding "super", so that we
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104022 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
e2aaf39abf0e4c6c293a9842c23a1a44496d683b 18-May-2010 Ted Kremenek <kremenek@apple.com> Clean up test case and remove XFAIL. This test can now distinguish between
cases where Clang can suggest and fix and suggest and not auto-fix (because of
current limitations).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103987 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
ba5f6eced29937e4e4851a2c0980744768413d66 24-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
files with the additional suffix in the middle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102230 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-at.c
ixit-c90.c
ixit-cxx0x.cpp
ixit-errors-1.c
ixit-errors.c
ixit-objc.m
ixit-pmem.cpp
ixit-suffix.c
ixit-unrecoverable.c
ixit.c
ixit.cpp
ypo.c
ypo.cpp
ypo.m
e5deae9555f097e8418583d8265ec6f333f48210 20-Apr-2010 Chris Lattner <sabre@nondot.org> fix the ?: fixit that ted added to recover properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101943 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
c220a18ecdfa42ebb3ce267974cf24e343e2aa6d 19-Apr-2010 Douglas Gregor <dgregor@apple.com> When searching for code-completion and typo-correction candidates,
look from an Objective-C class or category to its implementation, to
pick up synthesized ivars. Fixes a problem reported by David
Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101792 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
d4a97a18ea3cda3ba095e7c0c6708e7a39cf31db 15-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Teach -fixit to modify all of its inputs instead of just the main file, unless
-fixit-at specified a particular fixit to fix, or the -o flag was used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101359 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-errors.c
ixit-pmem.cpp
ypo.m
1aae80b173e22fa5d649f114eb6607efac350d79 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Thread a Scope pointer into BuildRecoveryCallExpr to help typo
correction find names when a call failed. Fixes
<rdar://problem/7853795>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101278 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
aaf87162c5fbfbf320072da3a8e83392e1bbf041 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Teach typo correction about various language keywords. We can't
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101274 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-unrecoverable.c
ixit-unrecoverable.cpp
ypo.m
47bd54392a4fd0f10e04de6a0420fd4838caaa0e 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement typo correction for Objective-C message sends when the
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".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101211 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
987aa87cf47811c44ac93afd1913c33f2829ed92 13-Apr-2010 Ted Kremenek <kremenek@apple.com> Add fixit hint for missing ':' in ternary expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101073 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
03a4bee558b63ead66e942c6b26381df9a8b1754 09-Apr-2010 Ted Kremenek <kremenek@apple.com> Remove fixit for string literal comparison. Telling the user to use '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'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100890 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
7002f4c03c2d0544f4e8bea8d3a5636519081e35 09-Apr-2010 John McCall <rjmccall@apple.com> Turn access control on by default in -cc1.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
08a41901e18aeb91b87d031b93df70374af02564 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics like "initializing <type> from an expression of
type..." with "initializing <type> with an expression of type...",
which reads better. Thanks to John for the improved wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100873 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
d4eea8362605807327735727a9098abe1eb23b19 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~

Fixes <rdar://problem/7447179>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
2eef829b19bdc59976a827fa39b409440e352bff 24-Mar-2010 Douglas Gregor <dgregor@apple.com> When a declaration of a function is missing an exception specification
that was present in a prior declaration, emit a warning rather than a
hard error (which we did before, and still do with mismatched
exception specifications). Moreover, provide a fix-it hint with the
throw() clause that should be added, e.g.,

t.C:10:7: warning: 'operator new' is missing exception specification
'throw(std::bad_alloc)'
void *operator new(unsigned long sz)
^
throw(std::bad_alloc)

As part of this, disable the warning when we're missing an exception
specification on operator new, operator new[], operator delete, or
operator delete[] when exceptions are turned off (-fno-exceptions).

Fixes PR5957.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99388 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
7c2342dd4c9947806842e5aca3d2bb2e542853c9 10-Mar-2010 John McCall <rjmccall@apple.com> When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
6202119003aba91e5ff4e579cb9c26a8d1b9514f 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Fix a crash with ill-formed code within a method in an ill-formed
category implementation, which showed up during (attempted) typo
correction. Fixes <rdar://problem/7605289>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95334 91177308-0d34-0410-b5e6-96231b3b80d8
ypo-crash.m
ypo.m
28485232e411b4a296f629bcabd3904dbb9cd7be 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Make this fix-it test case actually fail when there is a problem; add
a test for access declarations and remove a (broken) test for removal
of default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95032 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
3ac1edaab9063f1235a2939ca82ba4db24bbf695 20-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to implement required warnings for unimplemented
properties imported frfom protocol. Fixes radar 7544809.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93965 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
539c5c34063066753f27bb0f39fdcde1acc06328 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92879 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
0d535c89c5d02017153fb971e1ef080cd80cb4b8 07-Jan-2010 Douglas Gregor <dgregor@apple.com> When we typo-correct a base class initializer, point to the base class
specifier that we corrected to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92878 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
67dd1d4df1b28973e12e0981129b2517d2033b66 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92877 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.c
ypo.cpp
ypo.m
f06cdae9c68dfc4191fbf6b9e5ea0fd748488d88 03-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement typo correction for a variety of Objective-C-specific
constructs:

- Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
- Property name lookup ("foo.prop")
- Superclasses
- Various places where a class name is required
- Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92449 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
e3582011a63a78cdfa0917077ed87ccb9b3a87b5 01-Jan-2010 Douglas Gregor <dgregor@apple.com> Make sure that the search for visible declarations looks into the semantic parents of out-of-line function contexts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92397 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
736fc1b5884158387bfc49b8958ebc07b526d1da 01-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix typo test RUN lines

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92396 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.c
ypo.cpp
ypo.m
d203a162966cfc2157857f5fdfb0e30a4f669281 01-Jan-2010 Douglas Gregor <dgregor@apple.com> When typo correction for an id-expression finds a type (or Objective-C
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:

test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
mean 'NSString'?
NSstring *str = @"A string";
...
^
1 diagnostic generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92379 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.m
c171e3b192a372669cf622ff0b6a847f8e5b4220 01-Jan-2010 Douglas Gregor <dgregor@apple.com> Typo correction for C99 designated field initializers, e.g.,

test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
field in type 'struct Window'; did you mean 'bounds'?
.bunds.
^~~~~
bounds



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92376 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.c
fe0241e31dd2d1af60116adf6f71dedc88cd1f68 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for C++ base and member initializers, e.g.,

test/FixIt/typo.cpp:41:15: error: initializer 'base' does not name a non-static
data member or base class; did you mean the base class 'Base'?
Derived() : base(),
^~~~
Base
test/FixIt/typo.cpp:42:15: error: initializer 'ember' does not name a non-static
data member or base class; did you mean the member 'member'?
ember() { }
^~~~~
member



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92355 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
6c409a031946c069b7f8c33e7d71175563028afb 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Add another typo test for nested-name-specifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92351 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
175a65686eba7c7a9cb02412136fddd2d2c56dd7 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for identifiers within nested name specifiers, e.g.,

typo.cpp:18:1: error: use of undeclared identifier 'other_std'; did
you mean 'otherstd'?
other_std::strng str1;
^~~~~~~~~
otherstd




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92350 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
bfea239cafdb13256982eb891b151c5c07c1e7a9 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for template names, e.g.,

typo.cpp:27:8: error: no template named 'basic_sting' in namespace 'std';
did you mean 'basic_string'?
std::basic_sting<char> b2;
~~~~~^~~~~~~~~~~
basic_string



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92348 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
2dcc01195b7850692b9e25c65f77978e6a5a69a5 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for member access into classes/structs/unions, e.g.,

s.fnd("hello")




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92345 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
bb092bafa984e9fa05136b5cef40fd4374dea0f6 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement typo correction for id-expressions, e.g.,

typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
you mean 'radius'?
return radious * pi;
^~~~~~~
radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92341 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
546be3c5c000626c8cdf65e32e8ed9b90c424edd 30-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for type names when they appear in declarations, e.g., given

tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
tring str2;
^~~~~
string


To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92308 91177308-0d34-0410-b5e6-96231b3b80d8
ypo.cpp
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-at.c
ixit-c90.c
ixit-cxx0x.cpp
ixit-errors-1.c
ixit-errors.c
ixit-objc.m
ixit-pmem.cpp
ixit.c
ixit.cpp
01ed063edbddd72c1b3f3f7b060bf9a0766e5d09 14-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Make tests use the new clang -cc1 flag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91303 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
84fb9c0be621c9e4ca4e56f67dae2a0bb6e44821 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89655 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-cxx0x.cpp
d8aefab741a788ba308468df0c66c9dafb4c8530 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Drop unnecessary #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89154 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
266cc531d12873f8baa80ffd4011a1cb76c090fa 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Improve test to make sure -fixit is really working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88801 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
73dd7686d68fec7b5d7faa6d230be23ccfd9c41f 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Update FixIt tests to make it more obvious they use a separate mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88758 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-at.c
ixit-c90.c
ixit-errors-1.c
ixit-errors.c
ixit-objc.m
ixit-pmem.cpp
ixit.c
ixit.cpp
b76cd3d0c166b2162c4709f2ef5da8d67d9844b7 10-Nov-2009 Anders Carlsson <andersca@mac.com> When trying to assign a regular string literal to an Objective-C 'id' type or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example:

@class NSString;

@interface Test
+ (void)test:(NSString *)string;
@end

void g(NSString *a);

void f() {
NSString *a = "Foo";
g("Foo");
[Test test:"Foo"];
}

will produce

t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *'
NSString *a = "Foo";
^~~~~
@
t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *'
g("Foo");
^~~~~
@
t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *'
[Test test:"Foo"];
^~~~~
@
3 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86665 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
ad26b7376b6fd71d14b9b893eaa1ba79e029c830 10-Nov-2009 Anders Carlsson <andersca@mac.com> If a function with a default argument is redefined and the new function also has a defualt argument then add a fixit hint that removes the default argument. Fixes PR5444.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86659 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.cpp
4fcfde4d5c8f25e40720972a5543d538a0dcb220 08-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
3f0b5fd3a55baf1e3e768fe981bcc3ad5e209ec1 06-Nov-2009 Douglas Gregor <dgregor@apple.com> Rework the fix-it hint for code like

get_origin->x

where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86238 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-errors.c
ef78ac60136dc694ed383b3d0109224d97791d2f 26-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Add 'fixit' hint on mis-use of pointer-to-member
binary operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85153 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-pmem.cpp
8ae0639ac2a34a8fea50b03fca900e3ace477375 16-May-2009 Daniel Dunbar <daniel@zuster.org> Update test case; I'm confused why this wasn't failing on the buildbot
though?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71955 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-at.c
a86b832906d04e9867b792128ad19af39f7cc06b 06-Apr-2009 Douglas Gregor <dgregor@apple.com> Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68454 91177308-0d34-0410-b5e6-96231b3b80d8
ixit.c
75e3606728e30e00b3be0779243b55305e167828 03-Apr-2009 Chris Lattner <sabre@nondot.org> add fixit advice to an archiac ObjC issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68395 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-objc.m
81048aa3e5cbce181a850e2b2a8e266e4386347a 03-Apr-2009 Mike Stump <mrs@apple.com> Move the rest of the fixit tests to the FixIt area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68349 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-errors-1.c
26df2f09587ad6978ac8e357ca46b2731d591cc4 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add a new command-line option "-fixit-at=file:line:column" that only
applies fix-its to error messages that occur at that specific location
in the program.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68342 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-at.c
dd6f4abe816a529cfc8c0487f9a13f3b88f0aae8 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Move the fix-it tests into their own subdirectory

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68325 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit-errors.c
ixit.c
ixit.cpp