Commit Graph

11 Commits

Author SHA1 Message Date
Olivier Goffart 66be61ad4f Fix crash with two typos in the arguments of a function
The problem is that the arguments are of TheCall are reset later
to the ones in Args, making TypoExpr put back. Some TypoExpr that have
already  been diagnosed and will assert later in Sema::getTypoExprState

llvm-svn: 245560
2015-08-20 13:11:14 +00:00
Kaelyn Takata 72d16a581b Make the typo resolution in r240441 apply to all function calls.
Regular function calls (such as to cabs()) run into the same problem
with handling dependent exprs, not just builtins with custom type
checking.

Fixes PR23775.

llvm-svn: 240443
2015-06-23 19:13:17 +00:00
Kaelyn Takata e53f0f9019 Ensure delayed typos have been corrected in calls to builtins before
checking those calls when not in C++ mode, since those code paths can't
handle dependent exprs.

Fixes PR23740.

llvm-svn: 240441
2015-06-23 18:42:21 +00:00
Kaelyn Takata 5a53190623 Eagerly correct typos in ParenExprs that may be type casts for non-C++ code.
This is needed to ensure the type casts are parsed properly. Fixes
PR23101.

llvm-svn: 236337
2015-05-01 19:36:25 +00:00
Kaelyn Takata b939fb3478 Correct typos in C11 generic-selection expressions.
llvm-svn: 232760
2015-03-19 20:56:07 +00:00
Kaelyn Takata 05f4050928 Properly handle typos in the conditional of ?: expressions in C.
In particular, remove the OpaqueExpr transformation from r225389 and
move the correction of the conditional from CheckConditionalOperands to
ActOnConditionalOp before the OpaqueExpr is created. This fixes the
typo correction behavior in C code that uses the GNU extension for a
binary ?: (without an expression between the "?" and the ":").

llvm-svn: 227220
2015-01-27 18:26:18 +00:00
Olivier Goffart aabcb80096 Fix test from my previous commit
(I should have re-run the test after running clang-format)

llvm-svn: 225515
2015-01-09 09:42:32 +00:00
Olivier Goffart ed13fab4bc Fix crash in typo correction while correcting enum within a struct in C
llvm-svn: 225513
2015-01-09 09:37:26 +00:00
Kaelyn Takata 42118a9524 Handle OpaqueValueExprs more intelligently in the TransformTypos tree
transform.

Also diagnose typos in the initializer of an invalid C++ declaration.
Both issues were hit using the same line of test code, depending on
whether the code was treated as C or C++.

Fixes PR22092.

llvm-svn: 225389
2015-01-07 21:16:39 +00:00
Kaelyn Takata 13da33fdfe Force the correction of delayed typos in casts in non-C++ code.
Fixes PR21656, which is fallout from r222551 caused by an untested/missed
code path.

llvm-svn: 222694
2014-11-24 21:46:59 +00:00
Kaelyn Takata 1586782767 Enable ActOnIdExpression to use delayed typo correction for non-C++ code
when calling DiagnoseEmptyLookup.

llvm-svn: 222551
2014-11-21 18:48:04 +00:00