forked from OSchip/llvm-project
Do not return true from MergeFunctionDecl for a warn_static_non_static warning in Microsoft mode.
llvm-svn: 130010
This commit is contained in:
parent
ad8b4d402e
commit
6841a12845
|
|
@ -1258,12 +1258,14 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
|
||||||
New->getStorageClass() == SC_Static &&
|
New->getStorageClass() == SC_Static &&
|
||||||
Old->getStorageClass() != SC_Static &&
|
Old->getStorageClass() != SC_Static &&
|
||||||
!canRedefineFunction(Old, getLangOptions())) {
|
!canRedefineFunction(Old, getLangOptions())) {
|
||||||
unsigned DiagID = diag::err_static_non_static;
|
if (getLangOptions().Microsoft) {
|
||||||
if (getLangOptions().Microsoft)
|
Diag(New->getLocation(), diag::warn_static_non_static) << New;
|
||||||
DiagID = diag::warn_static_non_static;
|
Diag(Old->getLocation(), PrevDiag);
|
||||||
Diag(New->getLocation(), DiagID) << New;
|
} else {
|
||||||
Diag(Old->getLocation(), PrevDiag);
|
Diag(New->getLocation(), diag::err_static_non_static) << New;
|
||||||
return true;
|
Diag(Old->getLocation(), PrevDiag);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a function is first declared with a calling convention, but is
|
// If a function is first declared with a calling convention, but is
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue