Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 37a3cf8

Browse files
hughbejrose-apple
authored andcommitted
Fix MSVC errors building SemaAPINotes with MSVC
1 parent df81db6 commit 37a3cf8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/Sema/SemaAPINotes.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ namespace {
131131
Sema &S, Decl *D, bool shouldAddAttribute,
132132
VersionedInfoRole role,
133133
llvm::function_ref<A *()> createAttr,
134-
llvm::function_ref<specific_attr_iterator<A>(Decl *)> getExistingAttr =
135-
[](Decl *decl) { return decl->specific_attr_begin<A>(); }) {
134+
llvm::function_ref<specific_attr_iterator<A>(Decl *)> getExistingAttr) {
136135
switch (role) {
137136
case VersionedInfoRole::AugmentSource:
138137
// If we're not adding an attribute, there's nothing to do.
@@ -168,6 +167,17 @@ namespace {
168167
break;
169168
}
170169
}
170+
171+
template<typename A>
172+
void handleAPINotedAttribute(
173+
Sema &S, Decl *D, bool shouldAddAttribute,
174+
VersionedInfoRole role,
175+
llvm::function_ref<A *()> createAttr) {
176+
handleAPINotedAttribute<A>(S, D, shouldAddAttribute, role, createAttr,
177+
[](Decl *decl) {
178+
return decl->specific_attr_begin<A>();
179+
});
180+
}
171181
}
172182

173183
static void ProcessAPINotes(Sema &S, Decl *D,

0 commit comments

Comments
 (0)