]> granicus.if.org Git - clang/commit
Fix for PR43175: compiler crash when trying to emit noncapturable
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 10 Sep 2019 19:16:56 +0000 (19:16 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 10 Sep 2019 19:16:56 +0000 (19:16 +0000)
commit744ff96f70c6261a92dc496d34310f182e9c27d0
treec32266b1026f18eaac8f7ca3852e7b00a1a4f0ec
parente7a3af41563dec471f37e5c2b4a74d206b5865f1
Fix for PR43175: compiler crash when trying to emit noncapturable
constant.

If the constexpr variable is partially initialized, the initializer can
be emitted as the structure, not as an array, because of some early
optimizations. The llvm variable gets the type from this constant and,
thus, gets the type which is pointer to struct rather than pointer to an
array. We need to convert this type to be truely array, otherwise it may
lead to the compiler crash when trying to emit array subscript
expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371548 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
test/OpenMP/constexpr_partial_array.cpp [new file with mode: 0644]