diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-05-22 15:46:15 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-05-22 15:46:15 +0000 |
commit | f436b2837c3a5968aa757d6f2581d32940961ad8 (patch) | |
tree | 1bb5142d4a455939332c978d7bca108f4e895c3a /clang/lib/Sema/SemaDecl.cpp | |
parent | d6ac15dd5fce595f876edf2d0c1e072f6556a233 (diff) | |
download | bcm5719-llvm-f436b2837c3a5968aa757d6f2581d32940961ad8.tar.gz bcm5719-llvm-f436b2837c3a5968aa757d6f2581d32940961ad8.zip |
An inline function redeclaration does not drop the dllimport attribute
llvm-svn: 209449
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index d65ba117dc8..88f099f96d2 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -4898,9 +4898,11 @@ static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl, // A redeclaration is not allowed to drop a dllimport attribute, the only // exception being inline function definitions. - // FIXME: Handle inline functions. // NB: MSVC converts such a declaration to dllexport. - if (OldImportAttr && !HasNewAttr) { + bool IsInline = + isa<FunctionDecl>(NewDecl) && cast<FunctionDecl>(NewDecl)->isInlined(); + + if (OldImportAttr && !HasNewAttr && !IsInline) { S.Diag(NewDecl->getLocation(), diag::warn_redeclaration_without_attribute_prev_attribute_ignored) << NewDecl << OldImportAttr; |