From: Francois Pichet Date: Sun, 8 May 2011 10:02:20 +0000 (+0000) Subject: Look at all the record redeclaration when looking for a uuid attribute. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8db75a2b9c963a3bc0bf928e711353552f4fef79;p=clang 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 --- 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; }