diff options
| author | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 19:50:06 +0000 | 
|---|---|---|
| committer | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 19:50:06 +0000 | 
| commit | 6841a128450a1fc67b06fcccd633833eb00d30a8 (patch) | |
| tree | 33ccabfb679e980986bc102ae8c6fe8c45fb7fce /clang/lib | |
| parent | ad8b4d402e8a1edb2475098c0289784d7bd2d348 (diff) | |
| download | bcm5719-llvm-6841a128450a1fc67b06fcccd633833eb00d30a8.tar.gz bcm5719-llvm-6841a128450a1fc67b06fcccd633833eb00d30a8.zip  | |
Do not return true from MergeFunctionDecl for a warn_static_non_static warning in Microsoft mode.
llvm-svn: 130010
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 611031b4bd3..e506dd502a3 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1258,12 +1258,14 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {        New->getStorageClass() == SC_Static &&        Old->getStorageClass() != SC_Static &&        !canRedefineFunction(Old, getLangOptions())) { -    unsigned DiagID = diag::err_static_non_static; -    if (getLangOptions().Microsoft) -      DiagID = diag::warn_static_non_static; -    Diag(New->getLocation(), DiagID) << New; -    Diag(Old->getLocation(), PrevDiag); -    return true; +    if (getLangOptions().Microsoft) { +      Diag(New->getLocation(), diag::warn_static_non_static) << New; +      Diag(Old->getLocation(), PrevDiag); +    } else { +      Diag(New->getLocation(), diag::err_static_non_static) << New; +      Diag(Old->getLocation(), PrevDiag); +      return true; +    }    }    // If a function is first declared with a calling convention, but is  | 

