forked from OSchip/llvm-project
Fix a crash mangling decayed val argument-typed function.
// rdar: //8620510 and PR7666 llvm-svn: 118019
This commit is contained in:
parent
5d7be2e617
commit
dc9bc5aeb8
|
@ -1324,7 +1324,9 @@ void CXXNameMangler::mangleType(const ConstantArrayType *T) {
|
|||
}
|
||||
void CXXNameMangler::mangleType(const VariableArrayType *T) {
|
||||
Out << 'A';
|
||||
mangleExpression(T->getSizeExpr());
|
||||
// decayed vla types (size 0) will just be skipped.
|
||||
if (T->getSizeExpr())
|
||||
mangleExpression(T->getSizeExpr());
|
||||
Out << '_';
|
||||
mangleType(T->getElementType());
|
||||
}
|
||||
|
|
|
@ -624,3 +624,9 @@ namespace test20 {
|
|||
template <class T> void test1(decltype(f<>(T()))) {}
|
||||
template void test1<int>(decltype(f<>(int())));
|
||||
}
|
||||
|
||||
// rdar:// 8620510
|
||||
namespace test21 {
|
||||
// CHECK: define void @_ZN6test2112vla_arg_funcEiPA_i(
|
||||
void vla_arg_func(int X, int a[X][X]) {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue