llvm-project/clang/lib/Parse
Vedant Kumar a14a1f923f [Parse] Forward brace locations to TypeConstructExpr
When parsing C++ type construction expressions with list initialization,
forward the locations of the braces to Sema.

Without these locations, the code coverage pass crashes on the given test
case, because the pass relies on getLocEnd() returning a valid location.

Here is what this patch does in more detail:

  - Forwards init-list brace locations to Sema (ParseExprCXX),
  - Builds an InitializationKind with these locations (SemaExprCXX), and
  - Uses these locations for constructor initialization (SemaInit).

The remaining changes fall out of introducing a new overload for
creating direct-list InitializationKinds.

Testing: check-clang, and a stage2 coverage-enabled build of clang with
asserts enabled.

Differential Revision: https://reviews.llvm.org/D41921

llvm-svn: 322729
2018-01-17 18:53:51 +00:00
..
CMakeLists.txt
ParseAST.cpp C++ Modules TS: add frontend support for building pcm files from module 2016-08-26 00:14:38 +00:00
ParseCXXInlineMethods.cpp PR34163: Don't cache an incorrect key function for a class if queried between 2017-08-12 01:46:03 +00:00
ParseDecl.cpp Again reverting an attempt to convert the DeclSpec enums into scoped enums. 2018-01-01 18:23:28 +00:00
ParseDeclCXX.cpp Again reverting an attempt to convert the DeclSpec enums into scoped enums. 2018-01-01 18:23:28 +00:00
ParseExpr.cpp Again reverting an attempt to convert the DeclSpec enums into scoped enums. 2018-01-01 18:23:28 +00:00
ParseExprCXX.cpp [Parse] Forward brace locations to TypeConstructExpr 2018-01-17 18:53:51 +00:00
ParseInit.cpp Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-01 21:23:52 +00:00
ParseObjc.cpp Again reverting an attempt to convert the DeclSpec enums into scoped enums. 2018-01-01 18:23:28 +00:00
ParseOpenMP.cpp [OpenMP] Fix handling of clause on wrong directive, by Joel. E. Denny 2018-01-09 19:21:04 +00:00
ParsePragma.cpp Preserve unknown STDC pragma through preprocessor 2018-01-05 22:45:03 +00:00
ParseStmt.cpp [NFC] Modernize enum Declarator::TheContext to a type-safe scoped enum. 2017-12-29 05:41:00 +00:00
ParseStmtAsm.cpp Move MS inline asm parser methods out of line to reduce indentation, NFC 2017-10-26 17:07:48 +00:00
ParseTemplate.cpp [NFC] Modernize enum DeclSpecContext into a scoped enum. 2017-12-31 00:06:40 +00:00
ParseTentative.cpp Remove old concepts parsing code 2017-12-07 00:34:20 +00:00
Parser.cpp Again reverting an attempt to convert the DeclSpec enums into scoped enums. 2018-01-01 18:23:28 +00:00