[clang][ItaniumMangle] Check SizeExpr for DependentSizedArrayType
authoroToToT <ty1208chiang@gmail.com>
Thu, 1 Apr 2021 23:18:51 +0000 (07:18 +0800)
committeroToToT <ty1208chiang@gmail.com>
Fri, 2 Apr 2021 07:31:20 +0000 (15:31 +0800)
commita89fb29398dc0ce48dfe6f45f99d6ae7df4c6b46
treefafd45aa181eb2aa6b229d7e2544942f60690005
parent5d7c832e8c14ec0a2823528f8fbbfd3a9e96c828
[clang][ItaniumMangle] Check SizeExpr for DependentSizedArrayType
(PR49478)

As ArrayType::ArrayType mentioned in clang/lib/AST/Type.cpp, a
DependentSizedArrayType might not have size expression because it it
used as the type of a dependent array of unknown bound with a dependent
braced initializer.

Thus, I add a check when mangling array of that type.

This should fix https://bugs.llvm.org/show_bug.cgi?id=49478

Reviewed By: Richard Smith - zygoloid

Differential Revision: https://reviews.llvm.org/D99407
clang/lib/AST/ItaniumMangle.cpp
clang/unittests/AST/DeclTest.cpp