diff options
author | Shivanshu Goyal <shigoyal@microsoft.com> | 2020-12-16 12:01:54 -0800 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2020-12-16 12:03:31 -0800 |
commit | e53b9f733a7cb0a5da372b73ab6b7711c0300d65 (patch) | |
tree | 1700fc5561be07290c31dd484ab0d6b1bd796b2d /llvm/lib/CodeGen/MachineCheckDebugify.cpp | |
parent | 735ab86b811e40f1533ced98dfc4b7a0c09c545b (diff) | |
download | llvm-e53b9f733a7cb0a5da372b73ab6b7711c0300d65.zip llvm-e53b9f733a7cb0a5da372b73ab6b7711c0300d65.tar.gz llvm-e53b9f733a7cb0a5da372b73ab6b7711c0300d65.tar.bz2 |
Print source location in the error message when parens are missing around sizeof typename and the expression is inside macro expansion
Given the following code:
```
void Foo(int);
void Baz()
{
Bar(sizeof int);
}
```
The error message which is printed today is this:
```
error: expected parentheses around type name in sizeof expression
```
There is no source location printed whatsoever, so fixing a compile break like this becomes extremely hard in a large codebase.
My change improves the error message. But it doesn't output a FixItHint because I wasn't able to figure out how to get the locations for left and right parens. So any tips would be appreciated.
```
<source>:7:6: error: expected parentheses around type name in sizeof expression
Bar(sizeof int);
^
```
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D91129
Diffstat (limited to 'llvm/lib/CodeGen/MachineCheckDebugify.cpp')
0 files changed, 0 insertions, 0 deletions