Index: test/Sema/decl-microsoft-call-conv.c
===================================================================
--- test/Sema/decl-microsoft-call-conv.c	(revision 217881)
+++ test/Sema/decl-microsoft-call-conv.c	(working copy)
@@ -2,8 +2,20 @@
 
 // It's important that this is a .c file.
 
-// This is fine, as CrcGenerateTable() has a prototype.
-void __fastcall CrcGenerateTable(void);
-void __fastcall CrcGenerateTable() {}
+// This is fine, as CrcGenerateTable*() has a prototype.
+void __fastcall CrcGenerateTableFastcall(void);
+void __fastcall CrcGenerateTableFastcall() {}
+void __stdcall CrcGenerateTableStdcall(void);
+void __stdcall CrcGenerateTableStdcall() {}
+void __thiscall CrcGenerateTableThiscall(void);
+void __thiscall CrcGenerateTableThiscall() {}
+void __pascal CrcGenerateTablePascal(void);
+void __pascal CrcGenerateTablePascal() {}
 
-void __fastcall CrcGenerateTableNoProto() {} // expected-error{{function with no prototype cannot use fastcall calling convention}}
+void __fastcall CrcGenerateTableNoProtoFastcall() {} // expected-error{{function with no prototype cannot use fastcall calling convention}}
+void __stdcall CrcGenerateTableNoProtoStdcall() {} // expected-error{{function with no prototype cannot use stdcall calling convention}}
+void __thiscall CrcGenerateTableNoProtoThiscall() {} // expected-error{{function with no prototype cannot use thiscall calling convention}}
+void __pascal CrcGenerateTableNoProtoPascal() {} // expected-error{{function with no prototype cannot use pascal calling convention}}
+
+// Regular calling convention is fine.
+void CrcGenerateTableNoProto() {}
Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td	(revision 217881)
+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
@@ -2232,6 +2232,9 @@
   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
 def err_cconv_knr : Error<
   "function with no prototype cannot use %0 calling convention">;
+def warn_cconv_knr : Warning<
+  "function with no prototype cannot use %0 calling convention">,
+  DefaultError, InGroup<DiagGroup<"missing-prototype-for-cc">>;
 def err_cconv_varargs : Error<
   "variadic function cannot use %0 calling convention">;
 def warn_cconv_varargs : Warning<
Index: lib/Sema/SemaDecl.cpp
===================================================================
--- lib/Sema/SemaDecl.cpp	(revision 217881)
+++ lib/Sema/SemaDecl.cpp	(working copy)
@@ -7931,15 +7931,19 @@
 
   // Semantic checking for this function declaration (in isolation).
 
-  // Diagnose the use of X86 fastcall on unprototyped functions.
+  // Diagnose the use of callee-cleanup calls on unprototyped functions.
   QualType NewQType = Context.getCanonicalType(NewFD->getType());
   const FunctionType *NewType = cast<FunctionType>(NewQType);
   if (isa<FunctionNoProtoType>(NewType)) {
     FunctionType::ExtInfo NewTypeInfo = NewType->getExtInfo();
-    if (NewTypeInfo.getCC() == CC_X86FastCall)
-      Diag(NewFD->getLocation(), diag::err_cconv_knr)
-          << FunctionType::getNameForCallConv(CC_X86FastCall);
-    // TODO: Also diagnose unprototyped stdcall functions?
+    if (isCalleeCleanup(NewTypeInfo.getCC())) {
+      // MSVC system headers sometimes accidentally use stdcall without
+      // (void) parameters, so use a default-error warning in this case :-/
+      int DiagID = NewTypeInfo.getCC() == CC_X86StdCall
+          ? diag::warn_cconv_knr : diag::err_cconv_knr;
+      Diag(NewFD->getLocation(), DiagID)
+          << FunctionType::getNameForCallConv(NewTypeInfo.getCC());
+    }
   }
 
   if (getLangOpts().CPlusPlus) {
