]> granicus.if.org Git - clang/commitdiff
HasFunctionProto is a more strict version of FunctionLike. Since attribute subjects...
authorAaron Ballman <aaron@aaronballman.com>
Mon, 20 Jan 2014 14:18:40 +0000 (14:18 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 20 Jan 2014 14:18:40 +0000 (14:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199662 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Attr.td

index 586969268c93631116d3712c965647f99e20dfde..f1eb97ea77bf5d5ce70fb259170d9dc9066303a0 100644 (file)
@@ -65,6 +65,9 @@ def DeclBase : AttrSubject;
 def FunctionLike : SubsetSubject<DeclBase,
                                   [{S->getFunctionType(false) != NULL}]>;
 
+// HasFunctionProto is a more strict version of FunctionLike, so it should
+// never be specified in a Subjects list along with FunctionLike (due to the
+// inclusive nature of subject testing).
 def HasFunctionProto : SubsetSubject<DeclBase,
                                      [{(S->getFunctionType(true) != NULL &&
                               isa<FunctionProtoType>(S->getFunctionType())) ||
@@ -554,15 +557,15 @@ def Format : InheritableAttr {
   let Spellings = [GNU<"format">, CXX11<"gnu", "format">];
   let Args = [IdentifierArgument<"Type">, IntArgument<"FormatIdx">,
               IntArgument<"FirstArg">];
-  let Subjects = SubjectList<[ObjCMethod, Block, FunctionLike,
-                              HasFunctionProto], WarnDiag, "ExpectedFunction">;
+  let Subjects = SubjectList<[ObjCMethod, Block, HasFunctionProto], WarnDiag,
+                             "ExpectedFunction">;
 }
 
 def FormatArg : InheritableAttr {
   let Spellings = [GNU<"format_arg">, CXX11<"gnu", "format_arg">];
   let Args = [IntArgument<"FormatIdx">];
-  let Subjects = SubjectList<[ObjCMethod, FunctionLike, HasFunctionProto],
-                             WarnDiag, "ExpectedFunction">;
+  let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
+                             "ExpectedFunction">;
 }
 
 def GNUInline : InheritableAttr {
@@ -679,9 +682,8 @@ def NoMips16 : InheritableAttr, TargetSpecificAttr<TargetMips> {
 
 def NonNull : InheritableAttr {
   let Spellings = [GNU<"nonnull">, CXX11<"gnu", "nonnull">];
-  let Subjects = SubjectList<[ObjCMethod, FunctionLike, HasFunctionProto,
-                              ParmVar],
-                             WarnDiag, "ExpectedFunctionMethodOrParameter">;
+  let Subjects = SubjectList<[ObjCMethod, HasFunctionProto, ParmVar], WarnDiag,
+                             "ExpectedFunctionMethodOrParameter">;
   let Args = [VariadicUnsignedArgument<"Args">];
   let AdditionalMembers =
 [{bool isNonNull(unsigned idx) const {
@@ -695,8 +697,8 @@ def NonNull : InheritableAttr {
 
 def ReturnsNonNull : InheritableAttr {
   let Spellings = [GNU<"returns_nonnull">];
-  let Subjects = SubjectList<[ObjCMethod, FunctionLike, HasFunctionProto],
-                             WarnDiag, "ExpectedFunctionOrMethod">;
+  let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
+                             "ExpectedFunctionOrMethod">;
 }
 
 def NoReturn : InheritableAttr {
@@ -836,8 +838,7 @@ def Ownership : InheritableAttr {
     }
   }];
   let Args = [IdentifierArgument<"Module">, VariadicUnsignedArgument<"Args">];
-  let Subjects = SubjectList<[FunctionLike, HasFunctionProto], WarnDiag,
-                             "ExpectedFunction">;
+  let Subjects = SubjectList<[HasFunctionProto], WarnDiag, "ExpectedFunction">;
 }
 
 def Packed : InheritableAttr {