From: Dan Gohman Date: Wed, 17 Nov 2010 17:21:47 +0000 (+0000) Subject: Drop the warning about __attribute__((may_alias)) being used X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4659e1e2e06983e4de77040315537aa86984cec8;p=clang Drop the warning about __attribute__((may_alias)) being used on a non-type declaration, as GCC permits it on variables too. This fixes PR8635. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119517 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d66ae0a554..11ab63ee9d 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -738,12 +738,6 @@ static void HandleMayAliasAttr(Decl *d, const AttributeList &Attr, Sema &S) { return; } - if (!isa(d)) { - S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) - << Attr.getName() << 2 /*variable and function*/; - return; - } - d->addAttr(::new (S.Context) MayAliasAttr(Attr.getLoc(), S.Context)); }