[PATCH] [Sema] Handle TypoExpr for function calls correctly

Davide Italiano dccitaliano at gmail.com
Tue Jun 23 20:00:20 PDT 2015


On Tue, Jun 23, 2015 at 7:15 PM, Davide Italiano <dccitaliano at gmail.com> wrote:
> On Tue, Jun 23, 2015 at 6:59 PM, Meador Inge <meadori at gmail.com> wrote:
>> Maybe I am missing something, but I don't see Clang crash with the given test case (using HEAD).  In fact, the test case fails with and without the patch applied.
>>
>>
>> http://reviews.llvm.org/D10670
>>
>> EMAIL PREFERENCES
>>   http://reviews.llvm.org/settings/panel/emailpreferences/
>>
>>
>
> I was able to reproduce it right now on an older version of clang
> (r240290) -- maybe it's been fixed as side effect of some other
> commit?
> BTW, I'm updating my clang checkout to see if I can reproduce.
>
> Thanks,
>
>
>
> davide at ganondorf:/exps/llvm2/build/bin % ./clang foo.c -o foo
> Type not integer, floating, or complex
> UNREACHABLE executed at ../tools/clang/lib/Sema/SemaChecking.cpp:4620!
> clang-3.7: error: unable to execute command: Abort trap (core dumped)
> clang-3.7: error: clang frontend command failed due to signal (use -v
> to see invocation)
> clang version 3.7.0 (trunk 240290)
> Target: x86_64-unknown-freebsd11.0
> Thread model: posix
> clang-3.7: note: diagnostic msg: PLEASE submit a bug report to
> http://llvm.org/bugs/ and include the crash backtrace, preprocessed
> source, and associated run script.
> clang-3.7: note: diagnostic msg:
> ********************
>
> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> Preprocessed source(s) and associated run script(s) are located at:
> clang-3.7: note: diagnostic msg: /tmp/foo-9a681a.c
> clang-3.7: note: diagnostic msg: /tmp/foo-9a681a.sh
> clang-3.7: note: diagnostic msg:
>
> ********************
> davide at ganondorf:/exps/llvm2/build/bin % cat foo.c
> #include <math.h>
>
> int
> main(void)
> {
>
>   fabs(a);
> }

NVM, you're right, it doesn't crash on ToT.

davide at rabbit1:/exps/llvm2/build/bin % ./clang foo.c -o foo
foo.c:7:8: error: use of undeclared identifier 'a'
  fabs(a);
       ^
1 error generated.



More information about the cfe-commits mailing list