]> granicus.if.org Git - clang/commitdiff
Look at all the record redeclaration when looking for a uuid attribute.
authorFrancois Pichet <pichet2000@gmail.com>
Sun, 8 May 2011 10:02:20 +0000 (10:02 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Sun, 8 May 2011 10:02:20 +0000 (10:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131066 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp

index e9aa1d3bcf8e893e4ee4ed3a87269564df11ee9f..4aaba5603af4adc69e619c7cf480ed7457c27cb6 100644 (file)
@@ -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;
 }