Index: lib/Sema/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp	(revision 234484)
+++ lib/Sema/SemaChecking.cpp	(working copy)
@@ -1267,11 +1267,14 @@
 
 bool Sema::CheckPointerCall(NamedDecl *NDecl, CallExpr *TheCall,
                             const FunctionProtoType *Proto) {
-  const VarDecl *V = dyn_cast<VarDecl>(NDecl);
-  if (!V)
+  QualType Ty;
+  if (const auto *V = dyn_cast<VarDecl>(NDecl))
+    Ty = V->getType();
+  else if (const auto *F = dyn_cast<FieldDecl>(NDecl))
+    Ty = F->getType();
+  else
     return false;
 
-  QualType Ty = V->getType();
   if (!Ty->isBlockPointerType() && !Ty->isFunctionPointerType())
     return false;
 
Index: test/SemaCXX/format-strings.cpp
===================================================================
--- test/SemaCXX/format-strings.cpp	(revision 234484)
+++ test/SemaCXX/format-strings.cpp	(working copy)
@@ -133,3 +133,18 @@
   }
 }
 
+namespace implicit_this_tests {
+struct t {
+    void func1(const char *, ...) __attribute__((__format__(printf, 1, 2))); // expected-error {{format attribute cannot specify the implicit this argument as the format string}}
+    void (*func2)(const char *, ...) __attribute__((__format__(printf, 1, 2)));
+    static void (*func3)(const char *, ...) __attribute__((__format__(printf, 1, 2)));
+    static void func4(const char *, ...) __attribute__((__format__(printf, 1, 2)));
+};
+
+void f() {
+  t t1;
+  t1.func2("Hello %s"); // expected-warning {{more '%' conversions than data arguments}}
+  t::func3("Hello %s"); // expected-warning {{more '%' conversions than data arguments}}
+  t::func4("Hello %s"); // expected-warning {{more '%' conversions than data arguments}}
+}
+}
