llvm-project/clang/lib/Parse
Shivanshu Goyal e53b9f733a 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
2020-12-16 12:03:31 -08:00
..
CMakeLists.txt [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
ParseAST.cpp [Support] Add TimeTraceScope constructor without detail arg 2019-12-11 14:32:21 +00:00
ParseCXXInlineMethods.cpp [NFC, Refactor] Modernize enum FunctionDefinitionKind (DeclSpech.h) into a scoped enum 2020-11-21 09:49:52 -06:00
ParseDecl.cpp Fix inconsistent availability attribute message string literal check. 2020-12-08 12:33:59 -05:00
ParseDeclCXX.cpp [NFC, Refactor] Modernize enum FunctionDefinitionKind (DeclSpech.h) into a scoped enum 2020-11-21 09:49:52 -06:00
ParseExpr.cpp Print source location in the error message when parens are missing around sizeof typename and the expression is inside macro expansion 2020-12-16 12:03:31 -08:00
ParseExprCXX.cpp P0857R0: Parse a requires-clause after an explicit 2020-12-03 15:54:16 -08:00
ParseInit.cpp [clang][CodeComplete] Support for designated initializers 2020-01-28 16:34:15 +01:00
ParseObjc.cpp [NFC, Refactor] Rename the (scoped) enum DeclaratorContext's enumerators to remove duplication 2020-11-10 23:40:12 -06:00
ParseOpenMP.cpp Revert "[OpenMP] Add initial support for `omp [begin/end] assumes`" 2020-12-15 18:03:10 -06:00
ParsePragma.cpp Add option 'exceptions' to pragma clang fp 2020-10-31 17:36:12 +07:00
ParseStmt.cpp [NFC, Refactor] Rename the (scoped) enum DeclaratorContext's enumerators to remove duplication 2020-11-10 23:40:12 -06:00
ParseStmtAsm.cpp [Parser] ParseMicrosoftAsmStatement - Replace bit '|' operator with logical '||' operator. (PR47071) 2020-10-05 14:23:28 +01:00
ParseTemplate.cpp PR45699: Fix crash if an unexpanded parameter pack appears in a 2020-12-03 15:26:06 -08:00
ParseTentative.cpp [clang] Add a new nullability annotation for swift async: _Nullable_result 2020-12-07 17:19:20 -05:00
Parser.cpp [NFC, Refactor] Modernize enum FunctionDefinitionKind (DeclSpech.h) into a scoped enum 2020-11-21 09:49:52 -06:00