summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 9c03f39e68d..6a0c4c4d04a 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -2638,12 +2638,13 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx,
return Result.TakeString();
}
- for (Decl::attr_iterator i = ND->attr_begin(); i != ND->attr_end(); ++i) {
- if (AnnotateAttr *Attr = dyn_cast_or_null<AnnotateAttr>(*i)) {
- Result.AddAnnotation(Result.getAllocator().CopyString(Attr->getAnnotation()));
- }
- }
-
+ for (specific_attr_iterator<AnnotateAttr>
+ i = ND->specific_attr_begin<AnnotateAttr>(),
+ e = ND->specific_attr_end<AnnotateAttr>();
+ i != e; ++i)
+ Result.AddAnnotation(
+ Result.getAllocator().CopyString((*i)->getAnnotation()));
+
AddResultTypeChunk(Ctx, Policy, ND, Result);
if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(ND)) {
OpenPOWER on IntegriCloud