r236337 - Eagerly correct typos in ParenExprs that may be type casts for non-C++ code.

Kaelyn Takata rikka at google.com
Fri May 1 15:17:41 PDT 2015


It's probably another case where an expression with a delayed typo
correction in it is replaced with ExprError() after a parser error is hit,
without resolving any undiagnosed typos in the expression before dropping
it. I've added PR23285 to my queue of bugs to work on.

On Fri, May 1, 2015 at 3:03 PM, Dimitry Andric <dimitry at andric.com> wrote:

> On 01 May 2015, at 21:36, Kaelyn Takata <rikka at google.com> wrote:
> >
> > Author: rikka
> > Date: Fri May  1 14:36:25 2015
> > New Revision: 236337
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=236337&view=rev
> > Log:
> > 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.
>
> I had hoped this would also fix http://llvm.org/PR23285, but
> unfortunately it does not:
>
> $ ~/obj/llvm-236349-trunk-freebsd11-i386-ninja-rel-1/bin/clang -cc1
> -triple x86_64-unknown-freebsd11.0 -emit-obj testcase.c
> testcase.c:1:1: warning: type specifier missing, defaults to 'int'
> a = 0(uintmax_t
> ^
> testcase.c:1:16: error: expected ')'
> a = 0(uintmax_t
>                ^
> testcase.c:1:6: note: to match this '('
> a = 0(uintmax_t
>      ^
> testcase.c:1:16: error: expected ';' after top level declarator
> a = 0(uintmax_t
>                ^
>                ;
> Assertion failed: (DelayedTypos.empty() && "Uncorrected typos!"), function
> ~Sema, file /share/dim/src/llvm/trunk/tools/clang/lib/Sema/Sema.cpp, line
> 273.
> Abort trap (core dumped)
>
> Any idea? :-)
>
> -Dimitry
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150501/25eddde6/attachment.html>


More information about the cfe-commits mailing list