[microsoft] Move missing typename warning from -fms-extensions to -fms-compatibility. Also allow the missing typename warning at function scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140240 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 6ad8584..164fb2f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -280,7 +280,7 @@
if (Context.hasSameUnqualifiedType(QualType(Ty, 1), Base->getType()))
return true;
}
- return false;
+ return CurContext->isFunctionOrMethod();
}
bool Sema::DiagnoseUnknownTypeName(const IdentifierInfo &II,
@@ -362,7 +362,7 @@
<< &II << DC << SS->getRange();
else if (isDependentScopeSpecifier(*SS)) {
unsigned DiagID = diag::err_typename_missing;
- if (getLangOptions().MicrosoftExt && isMicrosoftMissingTypename(SS))
+ if (getLangOptions().MicrosoftMode && isMicrosoftMissingTypename(SS))
DiagID = diag::warn_typename_missing;
Diag(SS->getRange().getBegin(), DiagID)