From 37a3cf8e2588122e46f40a667656b1cd37f8644d Mon Sep 17 00:00:00 2001 From: Hugh Bellamy Date: Fri, 18 Nov 2016 17:31:58 +0000 Subject: [PATCH] Fix MSVC errors building SemaAPINotes with MSVC --- lib/Sema/SemaAPINotes.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaAPINotes.cpp b/lib/Sema/SemaAPINotes.cpp index cf88f735018..6173661d4ec 100644 --- a/lib/Sema/SemaAPINotes.cpp +++ b/lib/Sema/SemaAPINotes.cpp @@ -131,8 +131,7 @@ namespace { Sema &S, Decl *D, bool shouldAddAttribute, VersionedInfoRole role, llvm::function_ref createAttr, - llvm::function_ref(Decl *)> getExistingAttr = - [](Decl *decl) { return decl->specific_attr_begin(); }) { + llvm::function_ref(Decl *)> getExistingAttr) { switch (role) { case VersionedInfoRole::AugmentSource: // If we're not adding an attribute, there's nothing to do. @@ -168,6 +167,17 @@ namespace { break; } } + + template + void handleAPINotedAttribute( + Sema &S, Decl *D, bool shouldAddAttribute, + VersionedInfoRole role, + llvm::function_ref createAttr) { + handleAPINotedAttribute(S, D, shouldAddAttribute, role, createAttr, + [](Decl *decl) { + return decl->specific_attr_begin(); + }); + } } static void ProcessAPINotes(Sema &S, Decl *D,