From 908c4dcc5d617972ec57e9e42d708100e923d7a7 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 20 Jan 2012 01:38:51 +0000 Subject: [PATCH] [libclang] Fix crash when indexing attributes, rdar://10702250. llvm-svn: 148524 --- clang/test/Index/index-attrs.m | 7 +++++++ clang/tools/libclang/IndexingContext.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 clang/test/Index/index-attrs.m diff --git a/clang/test/Index/index-attrs.m b/clang/test/Index/index-attrs.m new file mode 100644 index 000000000000..1609b0fa52bc --- /dev/null +++ b/clang/test/Index/index-attrs.m @@ -0,0 +1,7 @@ +@class Foo; +@interface Bar +@property (retain) __attribute__((iboutletcollection(Foo))) Foo *prop; +@end + +// RUN: c-index-test -index-file %s | FileCheck %s +// CHECK: : attribute(iboutletcollection)= [IBOutletCollection=ObjCInterface] diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 1c58d23f54ca..3d70144db543 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/tools/libclang/IndexingContext.cpp @@ -49,7 +49,7 @@ IndexingContext::ObjCProtocolListInfo::ObjCProtocolListInfo( IBOutletCollectionInfo::IBOutletCollectionInfo( const IBOutletCollectionInfo &other) - : AttrInfo(CXIdxAttr_IBOutletCollection, other.cursor, other.loc, A) { + : AttrInfo(CXIdxAttr_IBOutletCollection, other.cursor, other.loc, other.A) { IBCollInfo.attrInfo = this; IBCollInfo.classCursor = other.IBCollInfo.classCursor;