An inline function redeclaration does not drop the dllimport attribute
llvm-svn: 209449
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d65ba11..88f099f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4898,9 +4898,11 @@
// 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;