From 68c880b5f9f95c1225338905ae63a5487b118f15 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 27 Sep 2013 07:57:34 +0000 Subject: AST: Handle multidimensional arrays inside of __uuidof() We previously handled one-dimensional arrays but didn't consider the general case. The fix is simple: keep going through subsequent dimensions until we get to the base element. llvm-svn: 191493 --- clang/lib/AST/ExprCXX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp index c7d2f78104b..a13d6f79c86 100644 --- a/clang/lib/AST/ExprCXX.cpp +++ b/clang/lib/AST/ExprCXX.cpp @@ -62,7 +62,7 @@ UuidAttr *CXXUuidofExpr::GetUuidAttrOfType(QualType QT, if (QT->isPointerType() || QT->isReferenceType()) Ty = QT->getPointeeType().getTypePtr(); else if (QT->isArrayType()) - Ty = cast(QT)->getElementType().getTypePtr(); + Ty = Ty->getBaseElementTypeUnsafe(); // Loop all record redeclaration looking for an uuid attribute. CXXRecordDecl *RD = Ty->getAsCXXRecordDecl(); -- cgit v1.2.3