summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TargetAttributesSema.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/TargetAttributesSema.cpp')
-rw-r--r--clang/lib/Sema/TargetAttributesSema.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp
index 80168480ac7..68f13494a3e 100644
--- a/clang/lib/Sema/TargetAttributesSema.cpp
+++ b/clang/lib/Sema/TargetAttributesSema.cpp
@@ -201,17 +201,9 @@ DLLExportAttr *Sema::mergeDLLExportAttr(Decl *D, SourceRange Range,
}
static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
- // Attribute can be applied only to functions or variables.
- FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
- if (!FD && !isa<VarDecl>(D)) {
- S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
- << Attr.getName() << 2 /*variable and function*/;
- return;
- }
-
// Currently, the dllexport attribute is ignored for inlined functions, unless
// the -fkeep-inline-functions flag has been used. Warning is emitted;
- if (FD && FD->isInlineSpecified()) {
+ if (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isInlineSpecified()) {
// FIXME: ... unless the -fkeep-inline-functions flag has been used.
S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName();
return;
OpenPOWER on IntegriCloud