diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-09-07 15:51:01 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-09-07 15:51:01 +0000 |
| commit | a7d6e3d0f5266c9337bd0c314daf9b192ed16ff6 (patch) | |
| tree | fb2a0f54f88c0fc0900c97769304daa1e8a716a2 /clang/lib/Sema/SemaDecl.cpp | |
| parent | 45d6bdfa88d57a6eb25800f4ee9f68feaf7d0902 (diff) | |
| download | bcm5719-llvm-a7d6e3d0f5266c9337bd0c314daf9b192ed16ff6.tar.gz bcm5719-llvm-a7d6e3d0f5266c9337bd0c314daf9b192ed16ff6.zip | |
Provide a specific diagnostic when trying to redefine an "extern
inline" function outside of GNU89 mode. Fixes
<rdar://problem/6880464>.
llvm-svn: 113204
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index f5e045a722a..df077fd7097 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -4806,7 +4806,12 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) { const FunctionDecl *Definition; if (FD->hasBody(Definition) && !canRedefineFunction(Definition, getLangOptions())) { - Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName(); + if (getLangOptions().GNUMode && Definition->isInlineSpecified() && + Definition->getStorageClass() == SC_Extern) + Diag(FD->getLocation(), diag::err_redefinition_extern_inline) + << FD->getDeclName() << getLangOptions().CPlusPlus; + else + Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName(); Diag(Definition->getLocation(), diag::note_previous_definition); } |

