From 1979007ca8cd11853d150699a138172eb16cd4e5 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sun, 21 Feb 2010 05:12:56 +0000 Subject: Don't emit a warning about a dllimport attribute being used in a typedef when -fms-extensions is specified. Fixes . llvm-svn: 96722 --- clang/lib/Sema/TargetAttributesSema.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/TargetAttributesSema.cpp') diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp index 35e42fb696b..87e7b9d00b0 100644 --- a/clang/lib/Sema/TargetAttributesSema.cpp +++ b/clang/lib/Sema/TargetAttributesSema.cpp @@ -115,8 +115,12 @@ static void HandleDLLImportAttr(Decl *D, const AttributeList &Attr, Sema &S) { FunctionDecl *FD = dyn_cast(D); if (!FD) { - S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) - << Attr.getName() << 2 /*variable and function*/; + // Apparently Visual C++ thinks it is okay to not emit a warning + // in this case, so only emit a warning when -fms-extensions is not + // specified. + if (!S.getLangOptions().Microsoft) + S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) + << Attr.getName() << 2 /*variable and function*/; return; } -- cgit v1.2.3