managed to insert an @interface as top level decl contained by another
@interface.
A commit to also not allow this as valid code will be coming.
rdar://
11105114.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153354
91177308-0d34-0410-b5e6-
96231b3b80d8
@synthesize prop = _prop;
@end
-// RUN: c-index-test -index-file %s | FileCheck %s
+rdar://11015325
+@interface I1
+__attribute__((something)) @interface I2 @end
+@end
+
+// RUN: c-index-test -index-file %s > %t
+// RUN: FileCheck %s -input-file=%t
// CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:12
// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 3:2
// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 2:25
}
void IndexingContext::indexTUDeclsInObjCContainer() {
- for (unsigned i = 0, e = TUDeclsInObjCContainer.size(); i != e; ++i)
- indexDeclGroupRef(TUDeclsInObjCContainer[i]);
- TUDeclsInObjCContainer.clear();
+ while (!TUDeclsInObjCContainer.empty()) {
+ DeclGroupRef DG = TUDeclsInObjCContainer.front();
+ TUDeclsInObjCContainer.pop_front();
+ indexDeclGroupRef(DG);
+ }
}
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclGroup.h"
#include "llvm/ADT/DenseSet.h"
+#include <deque>
namespace clang {
class FileEntry;
llvm::DenseSet<RefFileOccurence> RefFileOccurences;
- SmallVector<DeclGroupRef, 8> TUDeclsInObjCContainer;
+ std::deque<DeclGroupRef> TUDeclsInObjCContainer;
llvm::BumpPtrAllocator StrScratch;
unsigned StrAdapterCount;