diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-05-08 10:02:20 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-05-08 10:02:20 +0000 |
commit | 59d2b017d7eb8aa83a318eab52fe0b8e07845f8d (patch) | |
tree | 97dd2cdff32841bccf74a719b48c3e9b5b9f37f1 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | f30053d18d35d41ebb8c3df3cc7d7e857d95b706 (diff) | |
download | bcm5719-llvm-59d2b017d7eb8aa83a318eab52fe0b8e07845f8d.tar.gz bcm5719-llvm-59d2b017d7eb8aa83a318eab52fe0b8e07845f8d.zip |
Look at all the record redeclaration when looking for a uuid attribute.
llvm-svn: 131066
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index e9aa1d3bcf8..4aaba5603af 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -385,13 +385,14 @@ static UuidAttr *GetUuidAttrOfType(QualType QT) { else if (QT->isArrayType()) Ty = cast<ArrayType>(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<UuidAttr>()) + for (CXXRecordDecl::redecl_iterator I = RD->redecls_begin(), + E = RD->redecls_end(); I != E; ++I) { + if (UuidAttr *Uuid = I->getAttr<UuidAttr>()) return Uuid; - RD = RD->getPreviousDeclaration(); } + return 0; } |