]> granicus.if.org Git - clang/commitdiff
Drop the warning about __attribute__((may_alias)) being used
authorDan Gohman <gohman@apple.com>
Wed, 17 Nov 2010 17:21:47 +0000 (17:21 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 17 Nov 2010 17:21:47 +0000 (17:21 +0000)
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

lib/Sema/SemaDeclAttr.cpp

index d66ae0a554b6bcc483c0ce963f93f38e1e8fba5e..11ab63ee9ddb989e9a6213d62ec8448846dc9aa4 100644 (file)
@@ -738,12 +738,6 @@ static void HandleMayAliasAttr(Decl *d, const AttributeList &Attr, Sema &S) {
     return;
   }
 
-  if (!isa<TypeDecl>(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));
 }