From 8db75a2b9c963a3bc0bf928e711353552f4fef79 Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Sun, 8 May 2011 10:02:20 +0000 Subject: [PATCH] Look at all the record redeclaration when looking for a uuid attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131066 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExprCXX.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index e9aa1d3bcf..4aaba5603a 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -385,13 +385,14 @@ static UuidAttr *GetUuidAttrOfType(QualType QT) { else if (QT->isArrayType()) Ty = cast(QT)->getElementType().getTypePtr(); - // Loop all class definition and declaration looking for an uuid attribute. + // Loop all record redeclaration looking for an uuid attribute. CXXRecordDecl *RD = Ty->getAsCXXRecordDecl(); - while (RD) { - if (UuidAttr *Uuid = RD->getAttr()) + for (CXXRecordDecl::redecl_iterator I = RD->redecls_begin(), + E = RD->redecls_end(); I != E; ++I) { + if (UuidAttr *Uuid = I->getAttr()) return Uuid; - RD = RD->getPreviousDeclaration(); } + return 0; } -- 2.50.1