r186980 - Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.
Aaron Ballman
aaron at aaronballman.com
Tue Jul 23 12:30:12 PDT 2013
Author: aaronballman
Date: Tue Jul 23 14:30:11 2013
New Revision: 186980
URL: http://llvm.org/viewvc/llvm-project?rev=186980&view=rev
Log:
Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.
Thanks to Fariborz Jahanian for the suggestion!
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/lib/Sema/TargetAttributesSema.cpp
cfe/trunk/test/Sema/annotate.c
cfe/trunk/test/Sema/attr-cleanup.c
cfe/trunk/test/Sema/attr-naked.c
cfe/trunk/test/Sema/attr-nodebug.c
cfe/trunk/test/Sema/attr-noinline.c
cfe/trunk/test/Sema/attr-noreturn.c
cfe/trunk/test/Sema/attr-regparm.c
cfe/trunk/test/Sema/attr-returns-twice.c
cfe/trunk/test/Sema/attr-tls_model.c
cfe/trunk/test/Sema/attr-unused.c
cfe/trunk/test/Sema/callingconv.c
cfe/trunk/test/Sema/mips16_attr_allowed.c
cfe/trunk/test/Sema/neon-vector-types.c
cfe/trunk/test/Sema/overloadable.c
cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp
cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp
cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp
cfe/trunk/test/SemaCXX/init-priority-attr.cpp
cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp
cfe/trunk/test/SemaObjC/arc-unavailable-for-weakref.m
cfe/trunk/test/SemaObjC/attr-objc-gc.m
cfe/trunk/test/SemaObjC/attr-root-class.m
cfe/trunk/test/SemaObjC/default-synthesize-3.m
cfe/trunk/test/SemaObjC/format-arg-attribute.m
cfe/trunk/test/SemaObjC/iboutletcollection-attr.m
cfe/trunk/test/SemaObjC/nsobject-attribute.m
cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Jul 23 14:30:11 2013
@@ -1756,8 +1756,8 @@ def err_attribute_can_be_applied_only_to
def err_attributes_are_not_compatible : Error<
"%0 and %1 attributes are not compatible">;
def err_attribute_wrong_number_arguments : Error<
- "attribute %plural{0:takes no arguments|1:takes one argument|"
- ":requires exactly %0 arguments}0">;
+ "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
+ ":requires exactly %1 arguments}1">;
def err_attribute_too_many_arguments : Error<
"attribute takes no more than %0 argument%s0">;
def err_suppress_autosynthesis : Error<
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Tue Jul 23 14:30:11 2013
@@ -219,7 +219,8 @@ static inline bool isCFStringType(QualTy
static bool checkAttributeNumArgs(Sema &S, const AttributeList &Attr,
unsigned int Num) {
if (Attr.getNumArgs() != Num) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << Num;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << Num;
return false;
}
@@ -1111,7 +1112,8 @@ static void handleIBOutletCollection(Sem
// The iboutletcollection attribute can have zero or one arguments.
if (Attr.getParameterName() && Attr.getNumArgs() > 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -1344,14 +1346,16 @@ static void handleOwnershipAttr(Sema &S,
case AttributeList::AT_ownership_takes:
K = OwnershipAttr::Takes;
if (AL.getNumArgs() < 1) {
- S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << 2;
+ S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << AL.getName() << 2;
return;
}
break;
case AttributeList::AT_ownership_holds:
K = OwnershipAttr::Holds;
if (AL.getNumArgs() < 1) {
- S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << 2;
+ S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << AL.getName() << 2;
return;
}
break;
@@ -1359,7 +1363,7 @@ static void handleOwnershipAttr(Sema &S,
K = OwnershipAttr::Returns;
if (AL.getNumArgs() > 1) {
S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments)
- << AL.getNumArgs() + 1;
+ << AL.getName() << AL.getNumArgs() + 1;
return;
}
break;
@@ -1471,7 +1475,8 @@ static void handleOwnershipAttr(Sema &S,
llvm::array_pod_sort(start, start + size);
if (K != OwnershipAttr::Returns && OwnershipArgs.empty()) {
- S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << 2;
+ S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << AL.getName() << 2;
return;
}
@@ -1483,7 +1488,8 @@ static void handleOwnershipAttr(Sema &S,
static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// Check the attribute arguments.
if (Attr.getNumArgs() > 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -1660,7 +1666,8 @@ static void handleAlwaysInlineAttr(Sema
const AttributeList &Attr) {
// Check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -1713,7 +1720,8 @@ static void handleTLSModelAttr(Sema &S,
static void handleMallocAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// Check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -1786,7 +1794,8 @@ static void handleNoReturnAttr(Sema &S,
bool Sema::CheckNoReturnAttr(const AttributeList &attr) {
if (attr.hasParameterOrArguments()) {
- Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << attr.getName() << 0;
attr.setInvalid();
return true;
}
@@ -1924,7 +1933,8 @@ static void handleDependencyAttr(Sema &S
static void handleUnusedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -1944,7 +1954,8 @@ static void handleReturnsTwiceAttr(Sema
const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -1962,7 +1973,8 @@ static void handleReturnsTwiceAttr(Sema
static void handleUsedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -2445,7 +2457,8 @@ static void handleObjCMethodFamilyAttr(S
S.Diag(Attr.getLoc(), diag::err_attribute_argument_n_type)
<< Attr.getName() << 1 << ArgumentString;
} else {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
}
Attr.setInvalid();
return;
@@ -2555,7 +2568,8 @@ static void handleBlocksAttr(Sema &S, De
}
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -2711,7 +2725,8 @@ static void handleWarnUnusedResult(Sema
static void handleWeakAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -2908,7 +2923,8 @@ static void handleSectionAttr(Sema &S, D
static void handleNothrowAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -2925,7 +2941,8 @@ static void handleNothrowAttr(Sema &S, D
static void handleConstAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -2951,12 +2968,14 @@ static void handlePureAttr(Sema &S, Decl
static void handleCleanupAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (!Attr.getParameterName()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -3200,7 +3219,8 @@ static void handleFormatAttr(Sema &S, De
}
if (Attr.getNumArgs() != 2) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 3;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 3;
return;
}
@@ -3434,7 +3454,8 @@ static void handleAnnotateAttr(Sema &S,
static void handleAlignedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
if (Attr.getNumArgs() > 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -3834,7 +3855,8 @@ static void handleConstantAttr(Sema &S,
if (S.LangOpts.CUDA) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -3856,7 +3878,8 @@ static void handleDeviceAttr(Sema &S, De
if (S.LangOpts.CUDA) {
// check the attribute arguments.
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -4076,7 +4099,8 @@ bool Sema::CheckCallingConvAttr(const At
unsigned ReqArgs = attr.getKind() == AttributeList::AT_Pcs ? 1 : 0;
if (attr.getNumArgs() != ReqArgs || attr.getParameterName()) {
- Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments) << ReqArgs;
+ Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << attr.getName() << ReqArgs;
attr.setInvalid();
return true;
}
@@ -4249,7 +4273,7 @@ static void handleArgumentWithTypeTagAtt
if (Attr.getNumArgs() != 2) {
S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
- << /* required args = */ 3;
+ << Attr.getName() << /* required args = */ 3;
return;
}
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Tue Jul 23 14:30:11 2013
@@ -3832,7 +3832,8 @@ static void HandleAddressSpaceTypeAttrib
// Check the attribute arguments.
if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
Attr.setInvalid();
return;
}
@@ -4079,7 +4080,8 @@ static bool handleObjCGCTypeAttr(TypePro
}
Qualifiers::GC GCAttr;
if (attr.getNumArgs() != 0) {
- S.Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << attr.getName() << 1;
attr.setInvalid();
return true;
}
@@ -4463,7 +4465,8 @@ static void HandleOpenCLImageAccessAttri
Sema &S) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
Attr.setInvalid();
return;
}
@@ -4503,7 +4506,8 @@ static void HandleVectorSizeAttr(QualTyp
Sema &S) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
Attr.setInvalid();
return;
}
@@ -4569,7 +4573,8 @@ static void HandleExtVectorTypeAttr(Qual
} else {
// check the attribute arguments.
if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
sizeExpr = Attr.getArg(0);
@@ -4594,7 +4599,8 @@ static void HandleNeonVectorTypeAttr(Qua
const char *AttrName) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
Attr.setInvalid();
return;
}
Modified: cfe/trunk/lib/Sema/TargetAttributesSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TargetAttributesSema.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TargetAttributesSema.cpp (original)
+++ cfe/trunk/lib/Sema/TargetAttributesSema.cpp Tue Jul 23 14:30:11 2013
@@ -30,7 +30,8 @@ static void HandleMSP430InterruptAttr(De
const AttributeList &Attr, Sema &S) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -75,7 +76,8 @@ static void HandleMBlazeInterruptHandler
Sema &S) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -90,7 +92,8 @@ static void HandleMBlazeSaveVolatilesAtt
Sema &S) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 1;
return;
}
@@ -125,7 +128,8 @@ static void HandleX86ForceAlignArgPointe
Sema &S) {
// Check the attribute arguments.
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -177,7 +181,8 @@ DLLImportAttr *Sema::mergeDLLImportAttr(
static void HandleDLLImportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
// check the attribute arguments.
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -223,7 +228,8 @@ DLLExportAttr *Sema::mergeDLLExportAttr(
static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
// check the attribute arguments.
if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
@@ -280,7 +286,8 @@ namespace {
static void HandleMips16Attr(Decl *D, const AttributeList &Attr, Sema &S) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
// Attribute can only be applied to function types.
@@ -296,7 +303,8 @@ static void HandleMips16Attr(Decl *D, co
static void HandleNoMips16Attr(Decl *D, const AttributeList &Attr, Sema &S) {
// check the attribute arguments.
if (Attr.hasParameterOrArguments()) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
+ << Attr.getName() << 0;
return;
}
// Attribute can only be applied to function types.
Modified: cfe/trunk/test/Sema/annotate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/annotate.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/annotate.c (original)
+++ cfe/trunk/test/Sema/annotate.c Tue Jul 23 14:30:11 2013
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 %s -fsyntax-only -verify
-void __attribute__((annotate("foo"))) foo(float *a) {
+void __attribute__((annotate("foo"))) foo(float *a) {
__attribute__((annotate("bar"))) int x;
__attribute__((annotate(1))) int y; // expected-error {{argument to annotate attribute was not a string literal}}
- __attribute__((annotate("bar", 1))) int z; // expected-error {{attribute takes one argument}}
+ __attribute__((annotate("bar", 1))) int z; // expected-error {{'annotate' attribute takes one argument}}
int u = __builtin_annotation(z, (char*) 0); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
int v = __builtin_annotation(z, (char*) L"bar"); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
int w = __builtin_annotation(z, "foo");
Modified: cfe/trunk/test/Sema/attr-cleanup.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-cleanup.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-cleanup.c (original)
+++ cfe/trunk/test/Sema/attr-cleanup.c Tue Jul 23 14:30:11 2013
@@ -8,11 +8,11 @@ static int g3 __attribute((cleanup(c1)))
void t1()
{
- int v1 __attribute((cleanup)); // expected-error {{attribute takes one argument}}
- int v2 __attribute((cleanup(1, 2))); // expected-error {{attribute takes one argument}}
-
+ int v1 __attribute((cleanup)); // expected-error {{'cleanup' attribute takes one argument}}
+ int v2 __attribute((cleanup(1, 2))); // expected-error {{'cleanup' attribute takes one argument}}
+
static int v3 __attribute((cleanup(c1))); // expected-warning {{cleanup attribute ignored}}
-
+
int v4 __attribute((cleanup(h))); // expected-error {{'cleanup' argument 'h' not found}}
int v5 __attribute((cleanup(c1)));
Modified: cfe/trunk/test/Sema/attr-naked.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-naked.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-naked.c (original)
+++ cfe/trunk/test/Sema/attr-naked.c Tue Jul 23 14:30:11 2013
@@ -2,11 +2,11 @@
int a __attribute__((naked)); // expected-warning {{'naked' attribute only applies to functions}}
-__attribute__((naked)) int t0(void) {
+__attribute__((naked)) int t0(void) {
__asm__ volatile("mov r0, #0");
}
void t1() __attribute__((naked));
-void t2() __attribute__((naked(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((naked(2))); // expected-error {{'naked' attribute takes no arguments}}
Modified: cfe/trunk/test/Sema/attr-nodebug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-nodebug.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-nodebug.c (original)
+++ cfe/trunk/test/Sema/attr-nodebug.c Tue Jul 23 14:30:11 2013
@@ -4,8 +4,8 @@ int a __attribute__((nodebug));
void b() {
int b __attribute__((nodebug)); // expected-warning {{'nodebug' only applies to variables with static storage duration and functions}}
-}
+}
void t1() __attribute__((nodebug));
-void t2() __attribute__((nodebug(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((nodebug(2))); // expected-error {{'nodebug' attribute takes no arguments}}
Modified: cfe/trunk/test/Sema/attr-noinline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-noinline.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-noinline.c (original)
+++ cfe/trunk/test/Sema/attr-noinline.c Tue Jul 23 14:30:11 2013
@@ -4,5 +4,5 @@ int a __attribute__((noinline)); // expe
void t1() __attribute__((noinline));
-void t2() __attribute__((noinline(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((noinline(2))); // expected-error {{'noinline' attribute takes no arguments}}
Modified: cfe/trunk/test/Sema/attr-noreturn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-noreturn.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-noreturn.c (original)
+++ cfe/trunk/test/Sema/attr-noreturn.c Tue Jul 23 14:30:11 2013
@@ -13,7 +13,7 @@ int f1() __attribute__((noreturn));
int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' only applies to function types; type here is 'int'}}
-int f2() __attribute__((noreturn(1, 2))); // expected-error {{attribute takes no arguments}}
+int f2() __attribute__((noreturn(1, 2))); // expected-error {{'noreturn' attribute takes no arguments}}
void f3() __attribute__((noreturn));
void f3() {
@@ -33,7 +33,7 @@ extern void f5 (unsigned long) __attribu
void
f5 (unsigned long size)
{
-
+
}
// PR2461
@@ -41,4 +41,4 @@ __attribute__((noreturn)) void f(__attri
x();
}
-typedef void (*Fun)(void) __attribute__ ((noreturn(2))); // expected-error {{attribute takes no arguments}}
+typedef void (*Fun)(void) __attribute__ ((noreturn(2))); // expected-error {{'noreturn' attribute takes no arguments}}
Modified: cfe/trunk/test/Sema/attr-regparm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-regparm.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-regparm.c (original)
+++ cfe/trunk/test/Sema/attr-regparm.c Tue Jul 23 14:30:11 2013
@@ -4,7 +4,7 @@ __attribute((regparm(2))) int x0(void);
__attribute((regparm(1.0))) int x1(void); // expected-error{{'regparm' attribute requires integer constant}}
__attribute((regparm(-1))) int x2(void); // expected-error{{'regparm' parameter must be between 0 and 3 inclusive}}
__attribute((regparm(5))) int x3(void); // expected-error{{'regparm' parameter must be between 0 and 3 inclusive}}
-__attribute((regparm(5,3))) int x4(void); // expected-error{{attribute takes one argument}}
+__attribute((regparm(5,3))) int x4(void); // expected-error{{'regparm' attribute takes one argument}}
void __attribute__((regparm(3))) x5(int);
void x5(int); // expected-note{{previous declaration is here}}
Modified: cfe/trunk/test/Sema/attr-returns-twice.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-returns-twice.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-returns-twice.c (original)
+++ cfe/trunk/test/Sema/attr-returns-twice.c Tue Jul 23 14:30:11 2013
@@ -7,6 +7,6 @@ __attribute__((returns_twice)) void t0(v
void t1() __attribute__((returns_twice));
-void t2() __attribute__((returns_twice(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((returns_twice(2))); // expected-error {{'returns_twice' attribute takes no arguments}}
typedef void (*t3)(void) __attribute__((returns_twice)); // expected-warning {{'returns_twice' attribute only applies to functions}}
Modified: cfe/trunk/test/Sema/attr-tls_model.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-tls_model.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-tls_model.c (original)
+++ cfe/trunk/test/Sema/attr-tls_model.c Tue Jul 23 14:30:11 2013
@@ -9,6 +9,6 @@ int f() __attribute((tls_model("global-d
int x __attribute((tls_model("global-dynamic"))); // expected-error {{'tls_model' attribute only applies to thread-local variables}}
static __thread int y __attribute((tls_model("global-dynamic"))); // no-warning
-static __thread int y __attribute((tls_model("local", "dynamic"))); // expected-error {{attribute takes one argument}}
+static __thread int y __attribute((tls_model("local", "dynamic"))); // expected-error {{'tls_model' attribute takes one argument}}
static __thread int y __attribute((tls_model(123))); // expected-error {{argument to tls_model attribute was not a string literal}}
static __thread int y __attribute((tls_model("foobar"))); // expected-error {{tls_model must be "global-dynamic", "local-dynamic", "initial-exec" or "local-exec"}}
Modified: cfe/trunk/test/Sema/attr-unused.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-unused.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-unused.c (original)
+++ cfe/trunk/test/Sema/attr-unused.c Tue Jul 23 14:30:11 2013
@@ -9,7 +9,7 @@ int f1() __attribute__((unused));
int g0 __attribute__((unused));
-int f2() __attribute__((unused(1, 2))); // expected-error {{attribute takes no arguments}}
+int f2() __attribute__((unused(1, 2))); // expected-error {{'unused' attribute takes no arguments}}
struct Test0_unused {} __attribute__((unused));
struct Test0_not_unused {};
Modified: cfe/trunk/test/Sema/callingconv.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/callingconv.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/callingconv.c (original)
+++ cfe/trunk/test/Sema/callingconv.c Tue Jul 23 14:30:11 2013
@@ -1,12 +1,12 @@
// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -verify
-void __attribute__((fastcall)) foo(float *a) {
+void __attribute__((fastcall)) foo(float *a) {
}
-void __attribute__((stdcall)) bar(float *a) {
+void __attribute__((stdcall)) bar(float *a) {
}
-void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{attribute takes no arguments}}
+void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}}
}
void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use fastcall calling convention}}
@@ -20,7 +20,7 @@ void __attribute__((fastcall)) test2(int
void __attribute__((cdecl)) ctest0() {}
-void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{attribute takes no arguments}}
+void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{'cdecl' attribute takes no arguments}}
void (__attribute__((fastcall)) *pfoo)(float*) = foo;
@@ -36,9 +36,9 @@ void (__attribute__((cdecl)) *pctest2)()
typedef void (__attribute__((fastcall)) *Handler) (float *);
Handler H = foo;
-int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{attribute takes one argument}}
-int __attribute__((pcs())) pcs2(void); // expected-error {{attribute takes one argument}}
-int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{attribute takes one argument}}
+int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{'pcs' attribute takes one argument}}
+int __attribute__((pcs())) pcs2(void); // expected-error {{'pcs' attribute takes one argument}}
+int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute takes one argument}}
int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires parameter 1 to be a string}}
/* These are ignored because the target is i386 and not ARM */
int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
Modified: cfe/trunk/test/Sema/mips16_attr_allowed.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/mips16_attr_allowed.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/mips16_attr_allowed.c (original)
+++ cfe/trunk/test/Sema/mips16_attr_allowed.c Tue Jul 23 14:30:11 2013
@@ -2,22 +2,22 @@
void foo32();
void foo16();
-void __attribute__((nomips16)) foo32();
-void __attribute__((mips16)) foo16();
+void __attribute__((nomips16)) foo32();
+void __attribute__((mips16)) foo16();
-void __attribute__((nomips16)) foo32_();
-void __attribute__((mips16)) foo16_();
+void __attribute__((nomips16)) foo32_();
+void __attribute__((mips16)) foo16_();
void foo32_();
void foo16_();
-void foo32__() __attribute__((nomips16));
-void foo32__() __attribute__((mips16));
+void foo32__() __attribute__((nomips16));
+void foo32__() __attribute__((mips16));
-void foo32a() __attribute__((nomips16(xyz))) ; // expected-error {{attribute takes no arguments}}
-void __attribute__((mips16(xyz))) foo16a(); // expected-error {{attribute takes no arguments}}
+void foo32a() __attribute__((nomips16(xyz))) ; // expected-error {{'nomips16' attribute takes no arguments}}
+void __attribute__((mips16(xyz))) foo16a(); // expected-error {{'mips16' attribute takes no arguments}}
-void __attribute__((nomips16(1, 2))) foo32b(); // expected-error {{attribute takes no arguments}}
-void __attribute__((mips16(1, 2))) foo16b(); // expected-error {{attribute takes no arguments}}
+void __attribute__((nomips16(1, 2))) foo32b(); // expected-error {{'nomips16' attribute takes no arguments}}
+void __attribute__((mips16(1, 2))) foo16b(); // expected-error {{'mips16' attribute takes no arguments}}
__attribute((nomips16)) int a; // expected-error {{attribute only applies to functions}}
Modified: cfe/trunk/test/Sema/neon-vector-types.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/neon-vector-types.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/neon-vector-types.c (original)
+++ cfe/trunk/test/Sema/neon-vector-types.c Tue Jul 23 14:30:11 2013
@@ -16,7 +16,7 @@ typedef __attribute__((neon_polyvector_t
typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
// The attributes must have a single argument.
-typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{attribute takes one argument}}
+typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{'neon_vector_type' attribute takes one argument}}
// The number of elements must be an ICE.
typedef __attribute__((neon_vector_type(2.0))) int non_int_width; // expected-error{{attribute requires integer constant}}
Modified: cfe/trunk/test/Sema/overloadable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/overloadable.c?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/Sema/overloadable.c (original)
+++ cfe/trunk/test/Sema/overloadable.c Tue Jul 23 14:30:11 2013
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
int var __attribute__((overloadable)); // expected-error{{'overloadable' attribute can only be applied to a function}}
-void params(void) __attribute__((overloadable(12))); // expected-error {{attribute takes no arguments}}
+void params(void) __attribute__((overloadable(12))); // expected-error {{'overloadable' attribute takes no arguments}}
int *f(int) __attribute__((overloadable)); // expected-note 2{{previous overload of function is here}}
float *f(float); // expected-error{{overloaded function 'f' must have the 'overloadable' attribute}}
@@ -66,7 +66,7 @@ extern int __attribute__((overloadable))
typedef int f1_type();
f1_type __attribute__((overloadable)) f1; // expected-error{{'overloadable' function 'f1' must have a prototype}}
-void test() {
+void test() {
f0();
f1();
}
Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-address.cpp Tue Jul 23 14:30:11 2013
@@ -9,7 +9,7 @@
void noanal_fun() NO_SANITIZE_ADDRESS;
void noanal_fun_args() __attribute__((no_sanitize_address(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_sanitize_address' attribute takes no arguments}}
int noanal_testfn(int y) NO_SANITIZE_ADDRESS;
Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-memory.cpp Tue Jul 23 14:30:11 2013
@@ -9,7 +9,7 @@
void noanal_fun() NO_SANITIZE_MEMORY;
void noanal_fun_args() __attribute__((no_sanitize_memory(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_sanitize_memory' attribute takes no arguments}}
int noanal_testfn(int y) NO_SANITIZE_MEMORY;
Modified: cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-no-sanitize-thread.cpp Tue Jul 23 14:30:11 2013
@@ -9,7 +9,7 @@
void noanal_fun() NO_SANITIZE_THREAD;
void noanal_fun_args() __attribute__((no_sanitize_thread(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_sanitize_thread' attribute takes no arguments}}
int noanal_testfn(int y) NO_SANITIZE_THREAD;
Modified: cfe/trunk/test/SemaCXX/init-priority-attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/init-priority-attr.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/init-priority-attr.cpp (original)
+++ cfe/trunk/test/SemaCXX/init-priority-attr.cpp Tue Jul 23 14:30:11 2013
@@ -19,7 +19,7 @@ extern Two koo[];
Two foo __attribute__((init_priority(101))) ( 5, 6 );
-Two goo __attribute__((init_priority(2,3))) ( 5, 6 ); // expected-error {{attribute takes one argument}}
+Two goo __attribute__((init_priority(2,3))) ( 5, 6 ); // expected-error {{'init_priority' attribute takes one argument}}
Two coo[2] __attribute__((init_priority(3))); // expected-error {{init_priority attribute requires integer constant between 101 and 65535 inclusive}}
Modified: cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-thread-safety-parsing.cpp Tue Jul 23 14:30:11 2013
@@ -103,7 +103,7 @@ class Bar {
void noanal_fun() NO_THREAD_SAFETY_ANALYSIS;
void noanal_fun_args() __attribute__((no_thread_safety_analysis(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_thread_safety_analysis' attribute takes no arguments}}
int noanal_testfn(int y) NO_THREAD_SAFETY_ANALYSIS;
@@ -142,13 +142,13 @@ void noanal_fun_params(int lvar NO_THREA
int gv_var_noargs GUARDED_VAR;
int gv_var_args __attribute__((guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'guarded_var' attribute takes no arguments}}
class GVFoo {
private:
int gv_field_noargs GUARDED_VAR;
int gv_field_args __attribute__((guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'guarded_var' attribute takes no arguments}}
};
class GUARDED_VAR GV { // \
@@ -188,7 +188,7 @@ class PGVFoo {
int field_noargs PT_GUARDED_VAR; // \
// expected-warning {{'pt_guarded_var' only applies to pointer types; type here is 'int'}}
int *gv_field_args __attribute__((pt_guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'pt_guarded_var' attribute takes no arguments}}
};
class PT_GUARDED_VAR PGV { // \
@@ -196,7 +196,7 @@ class PT_GUARDED_VAR PGV { // \
};
int *pgv_var_args __attribute__((pt_guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'pt_guarded_var' attribute takes no arguments}}
void pgv_function() PT_GUARDED_VAR; // \
@@ -225,7 +225,7 @@ class LOCKABLE LTestClass {
};
class __attribute__((lockable (1))) LTestClass_args { // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'lockable' attribute takes no arguments}}
};
void l_test_function() LOCKABLE; // \
@@ -265,7 +265,7 @@ class SCOPED_LOCKABLE SLTestClass {
};
class __attribute__((scoped_lockable (1))) SLTestClass_args { // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'scoped_lockable' attribute takes no arguments}}
};
void sl_test_function() SCOPED_LOCKABLE; // \
@@ -308,15 +308,15 @@ void sl_function_params(int lvar SCOPED_
int gb_var_arg GUARDED_BY(mu1);
int gb_var_args __attribute__((guarded_by(mu1, mu2))); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'guarded_by' attribute takes one argument}}
int gb_var_noargs __attribute__((guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'guarded_by' attribute takes one argument}}
class GBFoo {
private:
int gb_field_noargs __attribute__((guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'guarded_by' attribute takes one argument}}
int gb_field_args GUARDED_BY(mu1);
};
@@ -374,12 +374,12 @@ int gb_var_arg_bad_4 GUARDED_BY(umu); //
//1. Check applied to the right types & argument number
int *pgb_var_noargs __attribute__((pt_guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'pt_guarded_by' attribute takes one argument}}
int *pgb_ptr_var_arg PT_GUARDED_BY(mu1);
int *pgb_ptr_var_args __attribute__((pt_guarded_by(mu1, mu2))); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'pt_guarded_by' attribute takes one argument}}
int pgb_var_args PT_GUARDED_BY(mu1); // \
// expected-warning {{'pt_guarded_by' only applies to pointer types; type here is 'int'}}
@@ -387,7 +387,7 @@ int pgb_var_args PT_GUARDED_BY(mu1); //
class PGBFoo {
private:
int *pgb_field_noargs __attribute__((pt_guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'pt_guarded_by' attribute takes one argument}}
int *pgb_field_args PT_GUARDED_BY(mu1);
};
@@ -931,12 +931,12 @@ int uf_function_bad_7() UNLOCK_FUNCTION(
// Takes exactly one argument, a var/field
void lr_function() __attribute__((lock_returned)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'lock_returned' attribute takes one argument}}
void lr_function_arg() LOCK_RETURNED(mu1);
void lr_function_args() __attribute__((lock_returned(mu1, mu2))); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'lock_returned' attribute takes one argument}}
int lr_testfn(int y) LOCK_RETURNED(mu1);
Modified: cfe/trunk/test/SemaObjC/arc-unavailable-for-weakref.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-unavailable-for-weakref.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-unavailable-for-weakref.m (original)
+++ cfe/trunk/test/SemaObjC/arc-unavailable-for-weakref.m Tue Jul 23 14:30:11 2013
@@ -87,6 +87,6 @@ __attribute__((objc_arc_weak_reference_u
@synthesize font = _font;
@end
-__attribute__((objc_arc_weak_reference_unavailable(1))) // expected-error {{attribute takes no arguments}}
+__attribute__((objc_arc_weak_reference_unavailable(1))) // expected-error {{'objc_arc_weak_reference_unavailable' attribute takes no arguments}}
@interface I3
@end
Modified: cfe/trunk/test/SemaObjC/attr-objc-gc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-objc-gc.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/attr-objc-gc.m (original)
+++ cfe/trunk/test/SemaObjC/attr-objc-gc.m Tue Jul 23 14:30:11 2013
@@ -4,7 +4,7 @@ static id __attribute((objc_gc(strong)))
static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
-static id __attribute((objc_gc(foo, 456))) e; // expected-error{{attribute takes one argument}}
+static id __attribute((objc_gc(foo, 456))) e; // expected-error{{'objc_gc' attribute takes one argument}}
static id __attribute((objc_gc(hello))) f; // expected-warning{{'objc_gc' attribute argument not supported: 'hello'}}
static int __attribute__((objc_gc(weak))) g; // expected-warning {{'objc_gc' only applies to pointer types; type here is 'int'}}
Modified: cfe/trunk/test/SemaObjC/attr-root-class.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-root-class.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/attr-root-class.m (original)
+++ cfe/trunk/test/SemaObjC/attr-root-class.m Tue Jul 23 14:30:11 2013
@@ -15,6 +15,6 @@ __attribute__((objc_root_class)) static
{
}
-__attribute__((objc_root_class(1))) // expected-error {{attribute takes no arguments}}
+__attribute__((objc_root_class(1))) // expected-error {{'objc_root_class' attribute takes no arguments}}
@interface I1
@end
Modified: cfe/trunk/test/SemaObjC/default-synthesize-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize-3.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize-3.m (original)
+++ cfe/trunk/test/SemaObjC/default-synthesize-3.m Tue Jul 23 14:30:11 2013
@@ -154,6 +154,6 @@ __attribute ((objc_requires_property_def
@synthesize failureCount = _failureCount;
@end
-__attribute ((objc_requires_property_definitions(1))) // expected-error {{attribute takes no arguments}}
+__attribute ((objc_requires_property_definitions(1))) // expected-error {{'objc_requires_property_definitions' attribute takes no arguments}}
@interface I1
@end
Modified: cfe/trunk/test/SemaObjC/format-arg-attribute.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/format-arg-attribute.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/format-arg-attribute.m (original)
+++ cfe/trunk/test/SemaObjC/format-arg-attribute.m Tue Jul 23 14:30:11 2013
@@ -5,9 +5,9 @@
extern NSString *fa2 (const NSString *) __attribute__((format_arg(1)));
extern NSString *fa3 (NSString *) __attribute__((format_arg(1)));
-extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-error {{attribute takes one argument}}
-extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{attribute takes one argument}}
-extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{attribute takes one argument}}
+extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-error {{'format_arg' attribute takes one argument}}
+extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{'format_arg' attribute takes one argument}}
+extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{'format_arg' attribute takes one argument}}
struct s1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}}
union u1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}}
Modified: cfe/trunk/test/SemaObjC/iboutletcollection-attr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/iboutletcollection-attr.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/iboutletcollection-attr.m (original)
+++ cfe/trunk/test/SemaObjC/iboutletcollection-attr.m Tue Jul 23 14:30:11 2013
@@ -18,14 +18,14 @@
typedef void *PV;
@interface BAD {
- __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{attribute takes one argument}}
+ __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{'iboutletcollection' attribute takes one argument}}
__attribute__((iboutletcollection(B))) id ivar2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
__attribute__((iboutletcollection(PV))) id ivar3; // expected-error {{invalid type 'PV' as argument of iboutletcollection attribute}}
__attribute__((iboutletcollection(PV))) void *ivar4; // expected-warning {{instance variable with 'iboutletcollection' attribute must be an object type (invalid 'void *')}}
__attribute__((iboutletcollection(int))) id ivar5; // expected-error {{type argument of iboutletcollection attribute cannot be a builtin type}}
__attribute__((iboutlet)) int ivar6; // expected-warning {{instance variable with 'iboutlet' attribute must be an object type}}
}
- at property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{attribute takes one argument}}
+ at property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{'iboutletcollection' attribute takes one argument}}
@property (nonatomic, retain) __attribute__((iboutletcollection(B))) id prop2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
@property __attribute__((iboutletcollection(BAD))) int prop3; // expected-warning {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
Modified: cfe/trunk/test/SemaObjC/nsobject-attribute.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/nsobject-attribute.m?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/nsobject-attribute.m (original)
+++ cfe/trunk/test/SemaObjC/nsobject-attribute.m Tue Jul 23 14:30:11 2013
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
typedef struct CGColor * __attribute__ ((NSObject)) CGColorRef;
-typedef struct CGColor * __attribute__((NSObject(12))) Illegal; // expected-error {{attribute takes no arguments}}
+typedef struct CGColor * __attribute__((NSObject(12))) Illegal; // expected-error {{'NSObject' attribute takes no arguments}}
static int count;
static CGColorRef tmp = 0;
Modified: cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl?rev=186980&r1=186979&r2=186980&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl (original)
+++ cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl Tue Jul 23 14:30:11 2013
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -verify %s
-kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{attribute takes one argument}}
+kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{'vec_type_hint' attribute takes one argument}}
kernel __attribute__((vec_type_hint(not_type))) void kernel2() {} //expected-error{{unknown type name 'not_type'}}
@@ -10,7 +10,7 @@ kernel __attribute__((vec_type_hint(bool
kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different parameters}}
-kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{attribute requires exactly 3 arguments}}
+kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{'work_group_size_hint' attribute requires exactly 3 arguments}}
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different parameters}}
More information about the cfe-commits
mailing list