aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-05-08 10:02:20 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-05-08 10:02:20 +0000
commit8db75a2b9c963a3bc0bf928e711353552f4fef79 (patch)
treee00b67ddca2eeb73a69a51242245b51e273b54cb /lib
parent377e1bd6853118c5b1718503569e5179c40f09b7 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExprCXX.cpp9
1 files 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<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;
}