forked from OSchip/llvm-project
Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
This commit is contained in:
parent
0b144e160a
commit
553b2b2e5d
|
@ -119,8 +119,7 @@ public:
|
|||
}
|
||||
|
||||
virtual bool Match(const std::string &S) {
|
||||
return S.find(Text) != std::string::npos ||
|
||||
Text.find(S) != std::string::npos;
|
||||
return S.find(Text) != std::string::npos;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ void f(BOOL b) {
|
|||
void f2(NSString *s) {
|
||||
CFStringRef ref;
|
||||
ref = [(CFStringRef)[s string] retain]; // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast}} \
|
||||
// expected-error {{ bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \
|
||||
// expected-error {{bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \
|
||||
// expected-note{{use __bridge to convert directly (no change in ownership)}} \
|
||||
// expected-note{{use __bridge_retained to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ CFAbsoluteTime f1_use_after_release() {
|
|||
[NSMakeCollectable(date) release];
|
||||
CFDateGetAbsoluteTime(date); // no-warning
|
||||
CFRelease(date);
|
||||
t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}}
|
||||
t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ CFAbsoluteTime f2_use_after_release() {
|
|||
[(id) CFMakeCollectable(date) release];
|
||||
CFDateGetAbsoluteTime(date); // no-warning
|
||||
CFRelease(date);
|
||||
t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}}
|
||||
t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,31 +97,31 @@ extern void *_NSConstantStringClassReference;
|
|||
|
||||
NSComparisonResult f1(NSString* s) {
|
||||
NSString *aString = 0;
|
||||
return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil.}}
|
||||
return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil}}
|
||||
}
|
||||
|
||||
NSComparisonResult f2(NSString* s) {
|
||||
NSString *aString = 0;
|
||||
return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil.}}
|
||||
return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil}}
|
||||
}
|
||||
|
||||
NSComparisonResult f3(NSString* s, NSStringCompareOptions op) {
|
||||
NSString *aString = 0;
|
||||
return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil.}}
|
||||
return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil}}
|
||||
}
|
||||
|
||||
NSComparisonResult f4(NSString* s, NSStringCompareOptions op, NSRange R) {
|
||||
NSString *aString = 0;
|
||||
return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil.}}
|
||||
return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil}}
|
||||
}
|
||||
|
||||
NSComparisonResult f5(NSString* s, NSStringCompareOptions op, NSRange R) {
|
||||
NSString *aString = 0;
|
||||
return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil.}}
|
||||
return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil}}
|
||||
}
|
||||
|
||||
NSArray *f6(NSString* s) {
|
||||
return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil.}}
|
||||
return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil}}
|
||||
}
|
||||
|
||||
NSString* f7(NSString* s1, NSString* s2, NSString* s3) {
|
||||
|
@ -189,7 +189,7 @@ void f13(void) {
|
|||
@end
|
||||
|
||||
void f14(MyString *s) {
|
||||
[s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil.}}
|
||||
[s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil}}
|
||||
}
|
||||
|
||||
// Test regular use of -autorelease
|
||||
|
|
|
@ -73,7 +73,7 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
|
|||
- (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}}
|
||||
@end
|
||||
@implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
||||
// expected-warning {{method in protocol not implemented}}
|
||||
+ (void) openForProjectDocument:(PBXProjectDocument *)projectDocument {
|
||||
}
|
||||
- (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data {
|
||||
|
|
|
@ -45,9 +45,9 @@ void creationViaCFCreate () {
|
|||
void makeCollectable () {
|
||||
CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
|
||||
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
|
||||
CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1.}}
|
||||
CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1}}
|
||||
NSMakeCollectable(leaked); // expected-note{{In GC mode a call to 'NSMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. Since it now has a 0 retain count the object can be automatically collected by the garbage collector}}
|
||||
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again.}}
|
||||
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again}}
|
||||
return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
|
||||
}
|
||||
|
||||
|
@ -61,12 +61,12 @@ void retainReleaseIgnored () {
|
|||
|
||||
@implementation Foo (FundamentalRuleUnderGC)
|
||||
- (id)getViolation {
|
||||
id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected.}}
|
||||
id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
|
||||
return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'getViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
|
||||
}
|
||||
|
||||
- (id)copyViolation {
|
||||
id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected.}}
|
||||
id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
|
||||
return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'copyViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -104,12 +104,12 @@ void makeCollectableIgnored () {
|
|||
}
|
||||
|
||||
CFTypeRef CFCopyRuleViolation () {
|
||||
CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain counte}}
|
||||
CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
|
||||
return object; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
|
||||
}
|
||||
|
||||
CFTypeRef CFGetRuleViolation () {
|
||||
CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain counte}}
|
||||
CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
|
||||
return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is return from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given the Memory Management Guide for Core Foundation}}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ CFAbsoluteTime f4() {
|
|||
CFDateGetAbsoluteTime(date); // no-warning
|
||||
x.f = (NSDate*) date;
|
||||
[((NSDate*) date) release];
|
||||
t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}}
|
||||
t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace M {
|
|||
int g(N::X); // expected-note{{candidate function}}
|
||||
|
||||
void test(N::X x) {
|
||||
g(x); // expected-error{{call to 'g' is ambiguous; candidates are:}}
|
||||
g(x); // expected-error{{call to 'g' is ambiguous}}
|
||||
int i = (g)(x);
|
||||
|
||||
int g(N::X);
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace Test {
|
|||
A::A() + A::A();
|
||||
B::B() + B::B();
|
||||
C::C() + C::C();
|
||||
D::D() + D::D(); // expected-error {{ invalid operands to binary expression ('D::D' and 'D::D') }}
|
||||
D::D() + D::D(); // expected-error {{invalid operands to binary expression ('D::D' and 'D::D')}}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ void resolves_to_different() {
|
|||
Value v;
|
||||
// The fact that the next line is a warning rather than an error is an
|
||||
// extension.
|
||||
v.set<double>(3.2); // expected-warning{{lookup of 'set' in member access expression is ambiguous; using member of 'Value' [-Wambiguous-member-template]}}
|
||||
v.set<double>(3.2); // expected-warning{{lookup of 'set' in member access expression is ambiguous; using member of 'Value'}}
|
||||
}
|
||||
{
|
||||
int set; // Non-template.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
void // expected-error {{error: 'main' must return 'int'}}
|
||||
main( // expected-error {{error: first parameter of 'main' (argument count) must be of type 'int'}}
|
||||
void // expected-error {{'main' must return 'int'}}
|
||||
main( // expected-error {{first parameter of 'main' (argument count) must be of type 'int'}}
|
||||
float a
|
||||
) {
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace test6 {
|
|||
class B : A {
|
||||
public_inner a;
|
||||
protected_inner b;
|
||||
private_inner c; // expected-error {{ 'private_inner' is a private member of 'test6::A'}}
|
||||
private_inner c; // expected-error {{'private_inner' is a private member of 'test6::A'}}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void D::glorp() {
|
|||
x++;
|
||||
f();
|
||||
y++; // expected-error{{member 'y' found in multiple base classes of different types}}
|
||||
g(); // expected-error{{error: member 'g' found in multiple base classes of different types}}
|
||||
g(); // expected-error{{member 'g' found in multiple base classes of different types}}
|
||||
}
|
||||
|
||||
// PR6462
|
||||
|
|
|
@ -29,35 +29,35 @@ class A {
|
|||
|
||||
friend class PreDeclared;
|
||||
friend class Outer::Inner;
|
||||
friend int Outer::Inner::intfield; // expected-error {{ friends can only be classes or functions }}
|
||||
friend int Outer::Inner::missing_field; //expected-error {{ friends can only be classes or functions }}
|
||||
friend int Outer::Inner::intfield; // expected-error {{friends can only be classes or functions}}
|
||||
friend int Outer::Inner::missing_field; //expected-error {{friends can only be classes or functions}}
|
||||
friend int myoperation(float); // okay
|
||||
friend int myglobal; // expected-error {{ friends can only be classes or functions }}
|
||||
friend int myglobal; // expected-error {{friends can only be classes or functions}}
|
||||
|
||||
friend void global_function();
|
||||
friend void global_c_function();
|
||||
|
||||
friend class UndeclaredSoFar;
|
||||
UndeclaredSoFar x; // expected-error {{ unknown type name 'UndeclaredSoFar' }}
|
||||
UndeclaredSoFar x; // expected-error {{unknown type name 'UndeclaredSoFar'}}
|
||||
|
||||
void a_member();
|
||||
friend void A::a_member(); // expected-error {{ friends cannot be members of the declaring class }}
|
||||
friend void A::a_member(); // expected-error {{friends cannot be members of the declaring class}}
|
||||
friend void a_member(); // okay (because we ignore class scopes when looking up friends)
|
||||
friend class A::AInner; // this is okay as an extension
|
||||
friend class AInner; // okay, refers to ::AInner
|
||||
|
||||
friend void Derived::missing_member(); // expected-error {{ no function named 'missing_member' with type 'void ()' was found in the specified scope }}
|
||||
friend void Derived::missing_member(); // expected-error {{no function named 'missing_member' with type 'void ()' was found in the specified scope}}
|
||||
|
||||
friend void Derived::base_member(); // expected-error {{ no function named 'base_member' with type 'void ()' was found in the specified scope }}
|
||||
friend void Derived::base_member(); // expected-error {{no function named 'base_member' with type 'void ()' was found in the specified scope}}
|
||||
|
||||
friend int Base::typedeffed_member(); // okay: should look through typedef
|
||||
|
||||
// These test that the friend is properly not being treated as a
|
||||
// member function.
|
||||
friend A operator|(const A& l, const A& r); // okay
|
||||
friend A operator|(const A& r); // expected-error {{ overloaded 'operator|' must be a binary operator (has 1 parameter) }}
|
||||
friend A operator|(const A& r); // expected-error {{overloaded 'operator|' must be a binary operator (has 1 parameter)}}
|
||||
|
||||
friend operator bool() const; // expected-error {{ must use a qualified name when declaring a conversion operator as a friend }} \
|
||||
friend operator bool() const; // expected-error {{must use a qualified name when declaring a conversion operator as a friend}} \
|
||||
// expected-error{{type qualifier is not allowed on this function}}
|
||||
|
||||
typedef void ftypedef();
|
||||
|
|
|
@ -17,7 +17,7 @@ struct X1 { // expected-note{{previous use is here}}
|
|||
};
|
||||
|
||||
struct X2 {
|
||||
typedef int X2; // expected-error{{member 'X2' has the same name as its class)}}
|
||||
typedef int X2; // expected-error{{member 'X2' has the same name as its class}}
|
||||
};
|
||||
|
||||
// - every enumerator of every member of class T that is an enumerated type; and
|
||||
|
|
|
@ -9,6 +9,6 @@ class Outer {
|
|||
class Inner {
|
||||
static char a[sizeof(x)]; // okay
|
||||
static char b[sizeof(sx)]; // okay
|
||||
static char c[sizeof(f)]; // expected-error {{ call to non-static member function without an object argument }}
|
||||
static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,8 +7,8 @@ class Outer {
|
|||
|
||||
// C++0x does relax this rule (see 5.1.1.10) in the first case, but we need to enforce it in C++03 mode.
|
||||
class Inner {
|
||||
static char a[sizeof(x)]; // expected-error {{ invalid use of nonstatic data member 'x' }}
|
||||
static char a[sizeof(x)]; // expected-error {{invalid use of nonstatic data member 'x'}}
|
||||
static char b[sizeof(sx)]; // okay
|
||||
static char c[sizeof(f)]; // expected-error {{ call to non-static member function without an object argument }}
|
||||
static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Test0 {
|
|||
test<2> _1 = (foo)(a);
|
||||
|
||||
class Test0::foo b;
|
||||
test<2> _2 = (foo)(b); // expected-error {{no viable conversion from 'class Test0::foo' to 'class ::foo' is possible}}
|
||||
test<2> _2 = (foo)(b); // expected-error {{no viable conversion from 'class Test0::foo' to 'class ::foo'}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace test2 {
|
|||
|
||||
class B : private A {
|
||||
protected:
|
||||
using A::operator int; // expected-note {{'declared protected here'}}
|
||||
using A::operator int; // expected-note {{declared protected here}}
|
||||
public:
|
||||
using A::operator bool;
|
||||
};
|
||||
|
|
|
@ -37,14 +37,14 @@ struct S {
|
|||
|
||||
// - the class shall not have any virtual base classes;
|
||||
struct T : virtual S { // expected-note {{here}}
|
||||
constexpr T(); // expected-error {{constexpr constructor not allowed in struct with virtual base classes}}
|
||||
constexpr T(); // expected-error {{constexpr constructor not allowed in struct with virtual base class}}
|
||||
};
|
||||
namespace IndirectVBase {
|
||||
struct A {};
|
||||
struct B : virtual A {}; // expected-note {{here}}
|
||||
class C : public B {
|
||||
public:
|
||||
constexpr C(); // expected-error {{constexpr constructor not allowed in class with virtual base classes}}
|
||||
constexpr C(); // expected-error {{constexpr constructor not allowed in class with virtual base class}}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ template<typename T> using Y = struct { // expected-error {{can not be defined i
|
|||
class K {
|
||||
virtual ~K();
|
||||
// FIXME: Diagnostic could use some work
|
||||
operator struct S {} (); // expected-error{{ 'operator S' cannot be the name of a variable or data member}} \
|
||||
operator struct S {} (); // expected-error{{'operator S' cannot be the name of a variable or data member}} \
|
||||
// expected-error{{expected ';' at end of declaration list}}
|
||||
};
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ template<typename T>
|
|||
T get_value_badly() {
|
||||
double *dp = 0;
|
||||
// The extension doesn't extend far enough to turn this error into a warning.
|
||||
T *tp = dp; // expected-error{{ cannot initialize a variable of type 'int *' with an lvalue of type 'double *'}}
|
||||
T *tp = dp; // expected-error{{cannot initialize a variable of type 'int *' with an lvalue of type 'double *'}}
|
||||
return T();
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ void g5(const X5&);
|
|||
|
||||
void test() {
|
||||
g1(X1());
|
||||
g2(X2()); // expected-warning{{C++98 requires an accessible copy constructor for class 'X2' when binding a reference to a temporary; was private [-Wbind-to-temporary-copy]}}
|
||||
g2(X2()); // expected-warning{{C++98 requires an accessible copy constructor for class 'X2' when binding a reference to a temporary; was private}}
|
||||
g3(X3()); // expected-warning{{no viable constructor copying parameter of type 'X3'}}
|
||||
g4(X4<int>());
|
||||
g5(X5()); // Generates a warning in the default argument.
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef intref &intrefref;
|
|||
template <class T> class RefMem { // expected-warning{{class 'RefMem<int &>' does not declare any constructor to initialize its non-modifiable members}}
|
||||
T
|
||||
&
|
||||
member; // expected-note{{ reference member 'member' will never be initialized}}
|
||||
member; // expected-note{{reference member 'member' will never be initialized}}
|
||||
};
|
||||
|
||||
struct RefRef {
|
||||
|
|
|
@ -116,7 +116,7 @@ int main()
|
|||
{ ptrdiff_t x = (ptrdiff_t) &twoT<int,int>;
|
||||
x = (ptrdiff_t) &twoT<int>; }
|
||||
|
||||
{ oneT<int>; &oneT<int>; } //expected-warning 2{{ expression result unused }}
|
||||
{ oneT<int>; &oneT<int>; } //expected-warning 2{{expression result unused}}
|
||||
{ static_cast<void>(cant_resolve<int>); } // expected-error {{address of overload}}
|
||||
{ bool b = cant_resolve<int>; } // expected-error {{address of overload}}
|
||||
{ (void) cant_resolve<int>; } // expected-error {{address of overload}}
|
||||
|
|
|
@ -128,7 +128,7 @@ void g() {
|
|||
void *begin(); // expected-note {{selected 'begin' function with iterator type 'void *'}}
|
||||
void *end();
|
||||
};
|
||||
for (auto u : NoIncr()) { // expected-error {{arithmetic on a pointer to void type}}
|
||||
for (auto u : NoIncr()) { // expected-error {{arithmetic on a pointer to void}}
|
||||
}
|
||||
|
||||
struct NoNotEq {
|
||||
|
|
|
@ -30,7 +30,7 @@ void test() {
|
|||
r1.top_left.x = 0;
|
||||
|
||||
typedef struct Rectangle Rectangle; // expected-note{{'Rectangle' declared here}}
|
||||
rectangle *r2 = &r1; // expected-error{{ unknown type name 'rectangle'; did you mean 'Rectangle'?}}
|
||||
rectangle *r2 = &r1; // expected-error{{unknown type name 'rectangle'; did you mean 'Rectangle'?}}
|
||||
r2->top_left.y = 0;
|
||||
unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}}
|
||||
*ptr = 17;
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
rdar://6096838
|
||||
*/
|
||||
|
||||
long double d = 0x0.0000003ffffffff00000p-16357L; /* expected-warning {{ hexadecimal floating constants are a C99 feature }} */
|
||||
long double d = 0x0.0000003ffffffff00000p-16357L; /* expected-warning {{hexadecimal floating constants are a C99 feature}} */
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
// U+00F5 U+00FC
|
||||
|
||||
void f() {
|
||||
wchar_t const *a = L"Àéîõü"; // expected-error {{ illegal sequence in string literal }}
|
||||
wchar_t const *a = L"Àéîõü"; // expected-error {{illegal sequence in string literal}}
|
||||
|
||||
char16_t const *b = u"Àéîõü"; // expected-error {{ illegal sequence in string literal }}
|
||||
char32_t const *c = U"Àéîõü"; // expected-error {{ illegal sequence in string literal }}
|
||||
wchar_t const *d = LR"(Àéîõü)"; // expected-error {{ illegal sequence in string literal }}
|
||||
char16_t const *e = uR"(Àéîõü)"; // expected-error {{ illegal sequence in string literal }}
|
||||
char32_t const *f = UR"(Àéîõü)"; // expected-error {{ illegal sequence in string literal }}
|
||||
char16_t const *b = u"Àéîõü"; // expected-error {{illegal sequence in string literal}}
|
||||
char32_t const *c = U"Àéîõü"; // expected-error {{illegal sequence in string literal}}
|
||||
wchar_t const *d = LR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}}
|
||||
char16_t const *e = uR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}}
|
||||
char32_t const *f = UR"(Àéîõü)"; // expected-error {{illegal sequence in string literal}}
|
||||
}
|
||||
|
|
|
@ -2,32 +2,32 @@
|
|||
|
||||
void f() {
|
||||
|
||||
const char* a = u8"abc" u"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char* b = u8"abc" U"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char* c = u8"abc" L"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char* d = u8"abc" uR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char* e = u8"abc" UR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char* f = u8"abc" LR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char* a = u8"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char* b = u8"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char* c = u8"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char* d = u8"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char* e = u8"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char* f = u8"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
|
||||
const char16_t* g = u"abc" u8"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char16_t* h = u"abc" U"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char16_t* i = u"abc" L"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char16_t* j = u"abc" u8R"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char16_t* k = u"abc" UR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char16_t* l = u"abc" LR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char16_t* g = u"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char16_t* h = u"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char16_t* i = u"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char16_t* j = u"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char16_t* k = u"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char16_t* l = u"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
|
||||
const char32_t* m = U"abc" u8"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char32_t* n = U"abc" u"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char32_t* o = U"abc" L"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char32_t* p = U"abc" u8R"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char32_t* q = U"abc" uR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char32_t* r = U"abc" LR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const char32_t* m = U"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char32_t* n = U"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char32_t* o = U"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char32_t* p = U"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char32_t* q = U"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const char32_t* r = U"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
|
||||
const wchar_t* s = L"abc" u8"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const wchar_t* t = L"abc" u"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const wchar_t* u = L"abc" U"abc"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const wchar_t* v = L"abc" u8R"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const wchar_t* w = L"abc" uR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const wchar_t* x = L"abc" UR"(abc)"; // expected-error {{ unsupported non-standard concatenation of string literals }}
|
||||
const wchar_t* s = L"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const wchar_t* t = L"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const wchar_t* u = L"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const wchar_t* v = L"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const wchar_t* w = L"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
const wchar_t* x = L"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace bar {
|
|||
}
|
||||
|
||||
void test(Foo::foo* x) {
|
||||
bar::f(x); // expected-error{{cannot initialize a parameter of type 'Foo::foo *' (aka 'bar::Foo::foo *') with an lvalue of type 'Foo::foo *')}}
|
||||
bar::f(x); // expected-error{{cannot initialize a parameter of type 'Foo::foo *' (aka 'bar::Foo::foo *') with an lvalue of type 'Foo::foo *'}}
|
||||
}
|
||||
|
||||
// PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'"
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s 2>&1 | FileCheck %s
|
||||
|
||||
// Test the -verify flag. Each of the "x = y;" lines will produce a
|
||||
// "use of undeclared identifier 'y'" error message.
|
||||
|
||||
void test() {
|
||||
int x;
|
||||
// Proper matches here.
|
||||
x = y; // expected-error{{use of undeclared identifier 'y'}}
|
||||
x = y; // expected-error{{use of undeclared identifier}}
|
||||
x = y; // expected-error{{undeclared identifier 'y'}}
|
||||
x = y; // expected-error{{use of}}
|
||||
x = y; // expected-error{{undeclared identifier}}
|
||||
x = y; // expected-error{{'y'}}
|
||||
|
||||
// Bad matches here.
|
||||
x = y; // expected-error{{use of undeclared identifier 'y' is fine}}
|
||||
x = y; // expected-error{{abuse of undeclared identifier 'y'}}
|
||||
x = y; // expected-error{{good use of undeclared identifier 'y' in code}}
|
||||
x = y; // expected-error{{ use of undeclared identifier 'y' }}
|
||||
x = y; // expected-error{{use of undeclared identifier 'y' is disallowed}}
|
||||
x = y; // expected-error{{please don't use of undeclared identifier 'y'}}
|
||||
x = y; // expected-error{{use of undeclared identifier 'y'; please declare y before use}}
|
||||
x = y; // expected-error{{use of use of undeclared identifier 'y'}}
|
||||
x = y; // expected-error{{use of undeclared identifier 'y' identifier 'y'}}
|
||||
}
|
||||
|
||||
//CHECK: error: 'error' diagnostics expected but not seen:
|
||||
//CHECK: Line 17: use of undeclared identifier 'y' is fine
|
||||
//CHECK: Line 18: abuse of undeclared identifier 'y'
|
||||
//CHECK: Line 19: good use of undeclared identifier 'y' in code
|
||||
//CHECK: Line 20: use of undeclared identifier 'y'
|
||||
//CHECK: Line 21: use of undeclared identifier 'y' is disallowed
|
||||
//CHECK: Line 22: please don't use of undeclared identifier 'y'
|
||||
//CHECK: Line 23: use of undeclared identifier 'y'; please declare y before use
|
||||
//CHECK: Line 24: use of use of undeclared identifier 'y'
|
||||
//CHECK: Line 25: use of undeclared identifier 'y' identifier 'y'
|
||||
//CHECK: error: 'error' diagnostics seen but not expected:
|
||||
//CHECK: Line 17: use of undeclared identifier 'y'
|
||||
//CHECK: Line 18: use of undeclared identifier 'y'
|
||||
//CHECK: Line 19: use of undeclared identifier 'y'
|
||||
//CHECK: Line 20: use of undeclared identifier 'y'
|
||||
//CHECK: Line 21: use of undeclared identifier 'y'
|
||||
//CHECK: Line 22: use of undeclared identifier 'y'
|
||||
//CHECK: Line 23: use of undeclared identifier 'y'
|
||||
//CHECK: Line 24: use of undeclared identifier 'y'
|
||||
//CHECK: Line 25: use of undeclared identifier 'y'
|
||||
//CHECK: 18 errors generated.
|
|
@ -21,7 +21,7 @@ __import_module__ macros;
|
|||
double d;
|
||||
DOUBLE *dp = &d;
|
||||
|
||||
#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE' to export}}
|
||||
#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE'}}
|
||||
|
||||
void f() {
|
||||
// CHECK-PREPROCESSED: int i = INTEGER;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Note: inside the module. expected-note{{ 'nested_umbrella_a' declared here}}
|
||||
// Note: inside the module. expected-note{{'nested_umbrella_a' declared here}}
|
||||
|
||||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/normal-module-map %s -verify
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
// In header: expected-note{{ 'boost::function' declared here}}
|
||||
// In header: expected-note{{'boost::function' declared here}}
|
||||
|
||||
|
||||
// In header: expected-note{{ 'boost::graph::adjacency_list' declared here}}
|
||||
// In header: expected-note{{'boost::graph::adjacency_list' declared here}}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ void f4() __attribute__((availability(macosx,introduced=10.5), availability(ios,
|
|||
|
||||
void f5() __attribute__((availability(macosx,introduced=10.5), availability(ios,unavailable, unavailable))); // expected-error{{redundant 'unavailable' availability change; only the last specified change will be used}}
|
||||
|
||||
void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{warning: 'unavailable' availability overrides all other availability information}}
|
||||
void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}}
|
||||
|
||||
// rdar://10095131
|
||||
enum E{
|
||||
|
|
|
@ -6,7 +6,7 @@ int @interface bla ; // expected-error {{cannot combine with previous 'int' dec
|
|||
typedef float CGFloat;
|
||||
@interface XNSNumber
|
||||
+ (XNSNumber *) numberWithCGFloat : (CGFloat) float; // expected-error {{expected identifier}} \
|
||||
// expected-error {{ expected ';' after method prototype}}
|
||||
// expected-error {{expected ';' after method prototype}}
|
||||
@end
|
||||
|
||||
// rdar: // 7822196
|
||||
|
|
|
@ -67,7 +67,7 @@ __vector double vv_d1; // expected-error {{cannot use 'double' wit
|
|||
vector double v_d2; // expected-error {{cannot use 'double' with '__vector'}}
|
||||
__vector long double vv_ld3; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
|
||||
vector long double v_ld4; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
|
||||
vector bool v_b; // expected-error {{error: C++ requires a type specifier for all declarations}}
|
||||
vector bool v_b; // expected-error {{C++ requires a type specifier for all declarations}}
|
||||
vector bool float v_bf; // expected-error {{cannot use 'float' with '__vector bool'}}
|
||||
vector bool double v_bd; // expected-error {{cannot use 'double' with '__vector bool'}}
|
||||
vector bool pixel v_bp; // expected-error {{cannot use '__pixel' with '__vector bool'}}
|
||||
|
|
|
@ -9,5 +9,5 @@ void f()
|
|||
{
|
||||
(void)typeid(int);
|
||||
(void)typeid(0);
|
||||
(void)typeid 1; // expected-error {{error: expected '(' after 'typeid'}}
|
||||
(void)typeid 1; // expected-error {{expected '(' after 'typeid'}}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ class C {
|
|||
[foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
|
||||
[foo,&this] {}; // expected-error {{'this' cannot be captured by reference}}
|
||||
[&this] {}; // expected-error {{'this' cannot be captured by reference}}
|
||||
[&,] {}; // expected-error {{ expected variable name or 'this' in lambda capture list}}
|
||||
[=,] {}; // expected-error {{ expected variable name or 'this' in lambda capture list}}
|
||||
[&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
|
||||
[=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
|
||||
[] {};
|
||||
[=] (int i) {};
|
||||
[&] (int) mutable -> void {};
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
void __assert_rtn(const char *, const char *, int, const char *) __attribute__((__noreturn__));
|
||||
static __inline__ int __inline_isfinitef (float ) __attribute__ ((always_inline));
|
||||
|
||||
@interface NSATSTypesetter (NSPantherCompatibility) // expected-error {{ "cannot find interface declaration for 'NSATSTypesetter'" }}
|
||||
@interface NSATSTypesetter (NSPantherCompatibility) // expected-error {{cannot find interface declaration for 'NSATSTypesetter'}}
|
||||
- (id)lineFragmentRectForProposedRect:(id)proposedRect remainingRect:(id)remainingRect __attribute__((deprecated));
|
||||
@end
|
||||
|
|
|
@ -30,7 +30,7 @@ typedef struct objc_object {
|
|||
for (id el in self)
|
||||
++i;
|
||||
MyList<P> ***p;
|
||||
for (p in self) // expected-error {{selector element type 'MyList<P> ***' is not a valid object type}}
|
||||
for (p in self) // expected-error {{selector element type 'MyList<P> ***' is not a valid object}}
|
||||
++i;
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ void test1() {
|
|||
id objects[] = {[NSNumber METH]};
|
||||
}
|
||||
|
||||
void test2(NSNumber x) { // expected-error {{Objective-C interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
|
||||
void test2(NSNumber x) { // expected-error {{interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
|
||||
id objects[] = {[x METH]};
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ void test(int a) {
|
|||
char (((( /* expected-note {{to match this '('}} */
|
||||
*X x ] )))); /* expected-error {{expected ')'}} */
|
||||
|
||||
; // expected-warning {{ISO C does not allow an extra ';' outside of a function}}
|
||||
; // expected-warning {{extra ';' outside of a function}}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ enum fee { // expected-note {{declaration has been explicitly marked unavailable
|
|||
t = 3
|
||||
}__attribute__((unavailable()));
|
||||
|
||||
enum fee f() { // expected-error {{error: 'fee' is unavailable}}
|
||||
int i = a; // expected-warning {{'a' is deprecated }}
|
||||
enum fee f() { // expected-error {{'fee' is unavailable}}
|
||||
int i = a; // expected-warning {{'a' is deprecated}}
|
||||
|
||||
i = b; // expected-warning {{'b' is deprecated}}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ void test18() {
|
|||
|
||||
// rdar://7072507
|
||||
int test19() {
|
||||
goto L0; // expected-error {{illegal goto into protected scope}}
|
||||
goto L0; // expected-error {{goto into protected scope}}
|
||||
|
||||
__block int x; // expected-note {{jump bypasses setup of __block variable}}
|
||||
L0:
|
||||
|
|
|
@ -28,7 +28,7 @@ void test7() {
|
|||
const void *X;
|
||||
X = CFSTR("\242"); // expected-warning {{input conversion stopped}}
|
||||
X = CFSTR("\0"); // no-warning
|
||||
X = CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}}
|
||||
X = CFSTR(242); // expected-error {{CFString literal is not a string constant}} expected-warning {{incompatible integer to pointer conversion}}
|
||||
X = CFSTR("foo", "bar"); // expected-error {{too many arguments to function call}}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ int printf(char const *, ...);
|
|||
|
||||
void test(void) {
|
||||
// size_t
|
||||
printf("%zu", (double)42); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double''}}
|
||||
printf("%zu", (double)42); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double'}}
|
||||
|
||||
// intmax_t / uintmax_t
|
||||
printf("%jd", (double)42); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long') but the argument has type 'double''}}
|
||||
printf("%ju", (double)42); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double''}}
|
||||
printf("%jd", (double)42); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long') but the argument has type 'double'}}
|
||||
printf("%ju", (double)42); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double'}}
|
||||
|
||||
// ptrdiff_t
|
||||
printf("%td", (double)42); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double''}}
|
||||
printf("%td", (double)42); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double'}}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ static void* malloc(int size) {
|
|||
return ((void*)0); /*do not use heap in this file*/
|
||||
}
|
||||
|
||||
void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc' will be ignored}} \
|
||||
void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc'}} \
|
||||
// expected-note{{'calloc' is a builtin with type 'void *}}
|
||||
|
||||
void f1(void) {
|
||||
|
|
|
@ -31,8 +31,8 @@ char *promote_or_convert(double _Complex) __attribute__((__overloadable__)); //
|
|||
int *promote_or_convert(long double _Complex) __attribute__((__overloadable__)); // expected-note 2 {{candidate function}}
|
||||
|
||||
void test_promote_or_convert(float f, float _Complex fc) {
|
||||
char *cp = promote_or_convert(fc); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
|
||||
int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
|
||||
char *cp = promote_or_convert(fc); // expected-error{{call to 'promote_or_convert' is ambiguous}}
|
||||
int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous}}
|
||||
}
|
||||
|
||||
char *promote_or_convert2(float) __attribute__((__overloadable__));
|
||||
|
|
|
@ -22,7 +22,7 @@ float *accept_funcptr(int (*)(int, double)) __attribute__((overloadable)); // \
|
|||
void test_funcptr(int (*f1)(int, double),
|
||||
int (*f2)(int, float)) {
|
||||
float *fp = accept_funcptr(f1);
|
||||
accept_funcptr(f2); // expected-error{{no matching function for call to 'accept_funcptr'; candidates are:}}
|
||||
accept_funcptr(f2); // expected-error{{no matching function for call to 'accept_funcptr'}}
|
||||
}
|
||||
|
||||
struct X { int x; float y; };
|
||||
|
|
|
@ -15,7 +15,7 @@ int f(__thread int t7) { // expected-error {{'__thread' is only allowed on varia
|
|||
__thread register int t13; // expected-error {{'__thread' variables must have global storage}}
|
||||
}
|
||||
__thread typedef int t14; // expected-error {{'__thread' is only allowed on variable declarations}}
|
||||
__thread int t15; // expected-note {{[previous definition is here}}
|
||||
__thread int t15; // expected-note {{previous definition is here}}
|
||||
int t15; // expected-error {{non-thread-local declaration of 't15' follows thread-local declaration}}
|
||||
int t16; // expected-note {{[previous definition is here}}
|
||||
int t16; // expected-note {{previous definition is here}}
|
||||
__thread int t16; // expected-error {{thread-local declaration of 't16' follows non-thread-local declaration}}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace ms_protected_scope {
|
|||
|
||||
int jump_over_variable_init(bool b) {
|
||||
if (b)
|
||||
goto foo; // expected-warning {{illegal goto into protected scope}}
|
||||
goto foo; // expected-warning {{goto into protected scope}}
|
||||
C c; // expected-note {{jump bypasses variable initialization}}
|
||||
foo:
|
||||
return 1;
|
||||
|
@ -51,7 +51,7 @@ void jump_over_var_with_dtor() {
|
|||
|
||||
|
||||
void exception_jump() {
|
||||
goto l2; // expected-error {{illegal goto into protected scope}}
|
||||
goto l2; // expected-error {{goto into protected scope}}
|
||||
try { // expected-note {{jump bypasses initialization of try block}}
|
||||
l2: ;
|
||||
} catch(int) {
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace test1 {
|
|||
private:
|
||||
class X; // expected-note {{previously declared 'private' here}}
|
||||
public:
|
||||
class X; // expected-error {{ 'X' redeclared with 'public' access}}
|
||||
class X; // expected-error {{'X' redeclared with 'public' access}}
|
||||
class X {};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@ int (*pfe)(...) = &f; // expected-error{{address of overloaded function 'f' d
|
|||
int (&rfi)(int) = f; // selects f(int)
|
||||
int (&rfd)(double) = f; // selects f(double)
|
||||
|
||||
void g(int (*fp)(int)); // expected-note{{note: candidate function}}
|
||||
void g(int (*fp)(int)); // expected-note{{candidate function}}
|
||||
void g(int (*fp)(float));
|
||||
void g(int (*fp)(double)); // expected-note{{note: candidate function}}
|
||||
void g(int (*fp)(double)); // expected-note{{candidate function}}
|
||||
|
||||
int g1(int);
|
||||
int g1(char);
|
||||
|
@ -29,7 +29,7 @@ int g3(char);
|
|||
|
||||
void g_test() {
|
||||
g(g1);
|
||||
g(g2); // expected-error{{call to 'g' is ambiguous; candidates are:}}
|
||||
g(g2); // expected-error{{call to 'g' is ambiguous}}
|
||||
g(g3);
|
||||
}
|
||||
|
||||
|
@ -98,8 +98,10 @@ namespace PR7971 {
|
|||
}
|
||||
|
||||
namespace PR8033 {
|
||||
template <typename T1, typename T2> int f(T1 *, const T2 *); // expected-note 2{{candidate function [with T1 = const int, T2 = int]}}
|
||||
template <typename T1, typename T2> int f(const T1 *, T2 *); // expected-note 2{{candidate function [with T1 = int, T2 = const int]}}
|
||||
template <typename T1, typename T2> int f(T1 *, const T2 *); // expected-note {{candidate function [with T1 = const int, T2 = int]}} \
|
||||
// expected-note{{candidate function}}
|
||||
template <typename T1, typename T2> int f(const T1 *, T2 *); // expected-note {{candidate function [with T1 = int, T2 = const int]}} \
|
||||
// expected-note{{candidate function}}
|
||||
int (*p)(const int *, const int *) = f; // expected-error{{address of overloaded function 'f' is ambiguous}} \
|
||||
// expected-error{{address of overloaded function 'f' is ambiguous}}
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s
|
||||
class C {
|
||||
public:
|
||||
auto int errx; // expected-error {{error: storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}}
|
||||
register int erry; // expected-error {{error: storage class specified for a member declaration}}
|
||||
extern int errz; // expected-error {{error: storage class specified for a member declaration}}
|
||||
auto int errx; // expected-error {{storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}}
|
||||
register int erry; // expected-error {{storage class specified for a member declaration}}
|
||||
extern int errz; // expected-error {{storage class specified for a member declaration}}
|
||||
|
||||
static void sm() {
|
||||
sx = 0;
|
||||
this->x = 0; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
|
||||
x = 0; // expected-error {{error: invalid use of member 'x' in static member function}}
|
||||
this->x = 0; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
|
||||
x = 0; // expected-error {{invalid use of member 'x' in static member function}}
|
||||
}
|
||||
|
||||
class NestedC {
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
sx = 0;
|
||||
this->x = 0;
|
||||
y = 0;
|
||||
this = 0; // expected-error {{error: expression is not assignable}}
|
||||
this = 0; // expected-error {{expression is not assignable}}
|
||||
}
|
||||
|
||||
int f1(int p) {
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
typedef int A;
|
||||
|
||||
virtual int viv; // expected-error {{'virtual' can only appear on non-static member functions}}
|
||||
virtual static int vsif(); // expected-error {{error: 'virtual' can only appear on non-static member functions}}
|
||||
virtual static int vsif(); // expected-error {{'virtual' can only appear on non-static member functions}}
|
||||
virtual int vif();
|
||||
|
||||
private:
|
||||
|
@ -65,9 +65,9 @@ private:
|
|||
static int sx;
|
||||
|
||||
mutable int mi;
|
||||
mutable int &mir; // expected-error {{error: 'mutable' cannot be applied to references}}
|
||||
mutable void mfn(); // expected-error {{error: 'mutable' cannot be applied to functions}}
|
||||
mutable const int mci; // expected-error {{error: 'mutable' and 'const' cannot be mixed}}
|
||||
mutable int &mir; // expected-error {{'mutable' cannot be applied to references}}
|
||||
mutable void mfn(); // expected-error {{'mutable' cannot be applied to functions}}
|
||||
mutable const int mci; // expected-error {{'mutable' and 'const' cannot be mixed}}
|
||||
|
||||
static const int number = 50;
|
||||
static int arr[number];
|
||||
|
@ -98,11 +98,11 @@ void f()
|
|||
}
|
||||
|
||||
// Play with mutable a bit more, to make sure it doesn't crash anything.
|
||||
mutable int gi; // expected-error {{error: 'mutable' can only be applied to member variables}}
|
||||
mutable int gi; // expected-error {{'mutable' can only be applied to member variables}}
|
||||
mutable void gfn(); // expected-error {{illegal storage class on function}}
|
||||
void ogfn()
|
||||
{
|
||||
mutable int ml; // expected-error {{error: 'mutable' can only be applied to member variables}}
|
||||
mutable int ml; // expected-error {{'mutable' can only be applied to member variables}}
|
||||
|
||||
// PR3020: This used to crash due to double ownership of C4.
|
||||
struct C4;
|
||||
|
|
|
@ -32,7 +32,7 @@ int *promote_or_convert(long double _Complex); // expected-note{{candidate funct
|
|||
|
||||
void test_promote_or_convert(float f, float _Complex fc) {
|
||||
char *cp = promote_or_convert(fc);
|
||||
int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
|
||||
int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous}}
|
||||
}
|
||||
|
||||
char *promote_or_convert2(float);
|
||||
|
|
|
@ -80,7 +80,7 @@ struct HasReference {
|
|||
};
|
||||
int global_int;
|
||||
HasReference r1 = { 1, global_int };
|
||||
HasReference r2 = { 1 } ; // expected-error{{initialization leaves reference member of type 'int &' uninitialized}}
|
||||
HasReference r2 = { 1 } ; // expected-error{{reference member of type 'int &' uninitialized}}
|
||||
|
||||
// C++ [dcl.init.aggr]p10
|
||||
// Note: the behavior here is identical to C
|
||||
|
|
|
@ -35,37 +35,37 @@ void throws() {
|
|||
void jumps() {
|
||||
l1:
|
||||
goto l5;
|
||||
goto l4; // expected-error {{illegal goto into protected scope}}
|
||||
goto l3; // expected-error {{illegal goto into protected scope}}
|
||||
goto l2; // expected-error {{illegal goto into protected scope}}
|
||||
goto l4; // expected-error {{goto into protected scope}}
|
||||
goto l3; // expected-error {{goto into protected scope}}
|
||||
goto l2; // expected-error {{goto into protected scope}}
|
||||
goto l1;
|
||||
try { // expected-note 4 {{jump bypasses initialization of try block}}
|
||||
l2:
|
||||
goto l5;
|
||||
goto l4; // expected-error {{illegal goto into protected scope}}
|
||||
goto l3; // expected-error {{illegal goto into protected scope}}
|
||||
goto l4; // expected-error {{goto into protected scope}}
|
||||
goto l3; // expected-error {{goto into protected scope}}
|
||||
goto l2;
|
||||
goto l1;
|
||||
} catch(int) { // expected-note 4 {{jump bypasses initialization of catch block}}
|
||||
l3:
|
||||
goto l5;
|
||||
goto l4; // expected-error {{illegal goto into protected scope}}
|
||||
goto l4; // expected-error {{goto into protected scope}}
|
||||
goto l3;
|
||||
goto l2; // expected-error {{illegal goto into protected scope}}
|
||||
goto l2; // expected-error {{goto into protected scope}}
|
||||
goto l1;
|
||||
} catch(...) { // expected-note 4 {{jump bypasses initialization of catch block}}
|
||||
l4:
|
||||
goto l5;
|
||||
goto l4;
|
||||
goto l3; // expected-error {{illegal goto into protected scope}}
|
||||
goto l2; // expected-error {{illegal goto into protected scope}}
|
||||
goto l3; // expected-error {{goto into protected scope}}
|
||||
goto l2; // expected-error {{goto into protected scope}}
|
||||
goto l1;
|
||||
}
|
||||
l5:
|
||||
goto l5;
|
||||
goto l4; // expected-error {{illegal goto into protected scope}}
|
||||
goto l3; // expected-error {{illegal goto into protected scope}}
|
||||
goto l2; // expected-error {{illegal goto into protected scope}}
|
||||
goto l4; // expected-error {{goto into protected scope}}
|
||||
goto l3; // expected-error {{goto into protected scope}}
|
||||
goto l2; // expected-error {{goto into protected scope}}
|
||||
goto l1;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace Conversion {
|
|||
// 13.3.1.4p1 & 8.5p16:
|
||||
Y y2 = z; // expected-error {{no viable conversion from 'Conversion::Z' to 'Conversion::Y'}}
|
||||
// FIXME: These are well-formed per C++0x 13.3.1.4p1 (see DR899).
|
||||
Y y3 = (Y)z; // expected-error {{no matching conversion for C-style cast from 'Conversion::Z' to 'Conversion::Y''}}
|
||||
Y y3 = (Y)z; // expected-error {{no matching conversion for C-style cast from 'Conversion::Z' to 'Conversion::Y'}}
|
||||
Y y4 = Y(z); // expected-error {{no matching conversion for functional-style cast from 'Conversion::Z' to 'Conversion::Y'}}
|
||||
Y y5 = static_cast<Y>(z); // expected-error {{no matching conversion for static_cast from 'Conversion::Z' to 'Conversion::Y'}}
|
||||
// 13.3.1.5p1 & 8.5p16:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
struct A; // expected-note 14 {{forward declaration of 'A'}}
|
||||
|
||||
A f(); // expected-note {{note: 'f' declared here}}
|
||||
A f(); // expected-note {{'f' declared here}}
|
||||
|
||||
struct B {
|
||||
A f(); // expected-note {{'f' declared here}}
|
||||
|
|
|
@ -9,7 +9,7 @@ fizbin::Foobar *my_foo = new fizbin::FooBar; // expected-error{{unknown type nam
|
|||
namespace barstool { int toFoobar() { return 1; } } // expected-note 3 {{'barstool::toFoobar' declared here}}
|
||||
int Double(int x) { return x + x; }
|
||||
void empty() {
|
||||
Double(toFoobar()); // expected-error{{{use of undeclared identifier 'toFoobar'; did you mean 'barstool::toFoobar'?}}
|
||||
Double(toFoobar()); // expected-error{{use of undeclared identifier 'toFoobar'; did you mean 'barstool::toFoobar'?}}
|
||||
}
|
||||
|
||||
namespace fizbin {
|
||||
|
@ -36,7 +36,7 @@ void Check() { // expected-note{{'Check' declared here}}
|
|||
}
|
||||
|
||||
void Alt() {
|
||||
Cleck(); // expected-error{{{use of undeclared identifier 'Cleck'; did you mean 'Check'?}}
|
||||
Cleck(); // expected-error{{use of undeclared identifier 'Cleck'; did you mean 'Check'?}}
|
||||
}
|
||||
|
||||
namespace N {
|
||||
|
|
|
@ -8,10 +8,10 @@ void test_f(int iv, float fv) {
|
|||
int* ip = f(iv);
|
||||
}
|
||||
|
||||
int* g(int, float, int); // expected-note {{ candidate function }}
|
||||
float* g(int, int, int); // expected-note {{ candidate function }}
|
||||
double* g(int, float, float); // expected-note {{ candidate function }}
|
||||
char* g(int, float, ...); // expected-note {{ candidate function }}
|
||||
int* g(int, float, int); // expected-note {{candidate function}}
|
||||
float* g(int, int, int); // expected-note {{candidate function}}
|
||||
double* g(int, float, float); // expected-note {{candidate function}}
|
||||
char* g(int, float, ...); // expected-note {{candidate function}}
|
||||
void g();
|
||||
|
||||
void test_g(int iv, float fv) {
|
||||
|
@ -21,7 +21,7 @@ void test_g(int iv, float fv) {
|
|||
char* cp1 = g(0, 0);
|
||||
char* cp2 = g(0, 0, 0, iv, fv);
|
||||
|
||||
double* dp2 = g(0, fv, 1.5); // expected-error {{ call to 'g' is ambiguous; candidates are: }}
|
||||
double* dp2 = g(0, fv, 1.5); // expected-error {{call to 'g' is ambiguous}}
|
||||
}
|
||||
|
||||
double* h(double f);
|
||||
|
@ -126,9 +126,9 @@ void test_bitfield(Bits bits, int x) {
|
|||
float* fp = bitfields(bits.uint_bitfield, 0u);
|
||||
}
|
||||
|
||||
int* multiparm(long, int, long); // expected-note {{ candidate function }}
|
||||
float* multiparm(int, int, int); // expected-note {{ candidate function }}
|
||||
double* multiparm(int, int, short); // expected-note {{ candidate function }}
|
||||
int* multiparm(long, int, long); // expected-note {{candidate function}}
|
||||
float* multiparm(int, int, int); // expected-note {{candidate function}}
|
||||
double* multiparm(int, int, short); // expected-note {{candidate function}}
|
||||
|
||||
void test_multiparm(long lv, short sv, int iv) {
|
||||
int* ip1 = multiparm(lv, iv, lv);
|
||||
|
@ -137,7 +137,7 @@ void test_multiparm(long lv, short sv, int iv) {
|
|||
float* fp2 = multiparm(sv, iv, iv);
|
||||
double* dp1 = multiparm(sv, sv, sv);
|
||||
double* dp2 = multiparm(iv, sv, sv);
|
||||
multiparm(sv, sv, lv); // expected-error {{ call to 'multiparm' is ambiguous; candidates are: }}
|
||||
multiparm(sv, sv, lv); // expected-error {{call to 'multiparm' is ambiguous}}
|
||||
}
|
||||
|
||||
// Test overloading based on qualification vs. no qualification
|
||||
|
@ -183,9 +183,9 @@ void test_quals_ranking(int * p, int volatile *pq, int * * pp, int * * * ppp) {
|
|||
|
||||
float* q6 = quals_rank2(pp);
|
||||
|
||||
quals_rank3(ppp); // expected-error {{call to 'quals_rank3' is ambiguous; candidates are:}}
|
||||
quals_rank3(ppp); // expected-error {{call to 'quals_rank3' is ambiguous}}
|
||||
|
||||
quals_rank3(p); // expected-error {{call to 'quals_rank3' is ambiguous; candidates are:}}
|
||||
quals_rank3(p); // expected-error {{call to 'quals_rank3' is ambiguous}}
|
||||
quals_rank3(pq);
|
||||
}
|
||||
|
||||
|
@ -266,8 +266,8 @@ float& cvqual_subsume2(const volatile Y&); // expected-note{{candidate function}
|
|||
Z get_Z();
|
||||
|
||||
void cvqual_subsume_test(Z z) {
|
||||
cvqual_subsume(z); // expected-error{{call to 'cvqual_subsume' is ambiguous; candidates are:}}
|
||||
int& x = cvqual_subsume2(get_Z()); // expected-error{{call to 'cvqual_subsume2' is ambiguous; candidates are:}}
|
||||
cvqual_subsume(z); // expected-error{{call to 'cvqual_subsume' is ambiguous}}
|
||||
int& x = cvqual_subsume2(get_Z()); // expected-error{{call to 'cvqual_subsume2' is ambiguous}}
|
||||
}
|
||||
|
||||
// Test overloading with cv-qualification differences in reference
|
||||
|
|
|
@ -32,7 +32,7 @@ struct X {
|
|||
|
||||
static void test_member_static() {
|
||||
double& d1 = g(0.0);
|
||||
g(0); // expected-error{{call to 'g' is ambiguous; candidates are:}}
|
||||
g(0); // expected-error{{call to 'g' is ambiguous}}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -41,8 +41,8 @@ void test(X x, const X xc, X* xp, const X* xcp, volatile X xv, volatile X* xvp)
|
|||
int& i2 = xcp->f(0);
|
||||
float& f1 = x.f(0);
|
||||
float& f2 = xp->f(0);
|
||||
xv.f(0); // expected-error{{no matching member function for call to 'f'; candidates are:}}
|
||||
xvp->f(0); // expected-error{{no matching member function for call to 'f'; candidates are:}}
|
||||
xv.f(0); // expected-error{{no matching member function for call to 'f'}}
|
||||
xvp->f(0); // expected-error{{no matching member function for call to 'f'}}
|
||||
|
||||
int& i3 = xc.g(0);
|
||||
int& i4 = xcp->g(0);
|
||||
|
@ -50,7 +50,7 @@ void test(X x, const X xc, X* xp, const X* xcp, volatile X xv, volatile X* xvp)
|
|||
float& f4 = xp->g(0);
|
||||
double& d1 = xp->g(0.0);
|
||||
double& d2 = X::g(0.0);
|
||||
X::g(0); // expected-error{{call to 'g' is ambiguous; candidates are:}}
|
||||
X::g(0); // expected-error{{call to 'g' is ambiguous}}
|
||||
|
||||
X::h(0); // expected-error{{call to non-static member function without an object argument}}
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ struct Arrow2 {
|
|||
void test_arrow(Arrow1 a1, Arrow2 a2, const Arrow2 a3) {
|
||||
int &i1 = a1->m;
|
||||
int &i2 = a2->m;
|
||||
a3->m; // expected-error{{no viable overloaded 'operator->'; candidate is}}
|
||||
a3->m; // expected-error{{no viable overloaded 'operator->'}}
|
||||
}
|
||||
|
||||
struct CopyConBase {
|
||||
|
|
|
@ -4,6 +4,6 @@ void fnptrs()
|
|||
{
|
||||
typedef void (*fnptr)();
|
||||
fnptr fp = 0;
|
||||
void *vp = reinterpret_cast<void*>(fp); // expected-warning {{reinterpret_cast between pointer-to-function and pointer-to-object is an extension}}
|
||||
(void)reinterpret_cast<fnptr>(vp); // expected-warning {{reinterpret_cast between pointer-to-function and pointer-to-object is an extension}}
|
||||
void *vp = reinterpret_cast<void*>(fp); // expected-warning {{cast between pointer-to-function and pointer-to-object is an extension}}
|
||||
(void)reinterpret_cast<fnptr>(vp); // expected-warning {{cast between pointer-to-function and pointer-to-object is an extension}}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace test1 {
|
|||
|
||||
int f(bool b) {
|
||||
if (b)
|
||||
goto foo; // expected-error {{illegal goto into protected scope}}
|
||||
goto foo; // expected-error {{goto into protected scope}}
|
||||
C c; // expected-note {{jump bypasses variable initialization}}
|
||||
foo:
|
||||
return 1;
|
||||
|
|
|
@ -10,7 +10,7 @@ struct X {
|
|||
};
|
||||
|
||||
void test2() {
|
||||
goto later; // expected-error {{illegal goto into protected scope}}
|
||||
goto later; // expected-error {{goto into protected scope}}
|
||||
X x; // expected-note {{jump bypasses variable initialization}}
|
||||
later:
|
||||
;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
|
||||
int x = this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
|
||||
|
||||
void f() {
|
||||
int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}}
|
||||
int x = this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
void f()
|
||||
{
|
||||
(void)typeid(int); // expected-error {{error: you need to include <typeinfo> before using the 'typeid' operator}}
|
||||
(void)typeid(int); // expected-error {{you need to include <typeinfo> before using the 'typeid' operator}}
|
||||
}
|
||||
|
||||
namespace std {
|
||||
|
|
|
@ -27,7 +27,7 @@ void unevaluated_tests() {
|
|||
struct A { virtual ~A() {} };
|
||||
void polymorphic_test() {
|
||||
A *a; // expected-note{{initialize the variable 'a' to silence this warning}}
|
||||
(void)typeid(*a); // expected-warning{{variable 'a' is uninitialized when used here }}
|
||||
(void)typeid(*a); // expected-warning{{variable 'a' is uninitialized when used here}}
|
||||
}
|
||||
|
||||
// Handle cases where the CFG may constant fold some branches, thus
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
int* j = false; // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
int* j = false; // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
|
||||
void foo(int* i, int *j=(false)) // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
void foo(int* i, int *j=(false)) // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
{
|
||||
foo(false); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
foo(false); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
foo((int*)false); // no-warning: explicit cast
|
||||
foo(0); // no-warning: not a bool, even though its convertible to bool
|
||||
|
||||
foo(false == true); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
foo((42 + 24) < 32); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
foo(false == true); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
foo((42 + 24) < 32); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
|
||||
const bool kFlag = false;
|
||||
foo(kFlag); // expected-warning{{ initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
foo(kFlag); // expected-warning{{initialization of pointer of type 'int *' to null from a constant boolean expression}}
|
||||
}
|
||||
|
||||
char f(struct Undefined*);
|
||||
|
|
|
@ -173,7 +173,7 @@ void sls_fun_bad_2() {
|
|||
|
||||
void sls_fun_bad_3() {
|
||||
sls_mu.Lock(); // \
|
||||
// expected-warning{{mutex 'sls_mu' is still locked at the end of function 'sls_fun_bad_3'}}
|
||||
// expected-warning{{mutex 'sls_mu' is still locked at the end of function}}
|
||||
}
|
||||
|
||||
void sls_fun_bad_4() {
|
||||
|
@ -241,7 +241,7 @@ void sls_fun_bad_9() {
|
|||
|
||||
void sls_fun_bad_10() {
|
||||
sls_mu.Lock(); // \
|
||||
// expected-warning{{mutex 'sls_mu' is still locked at the end of function 'sls_fun_bad_10'}} \
|
||||
// expected-warning{{mutex 'sls_mu' is still locked at the end of function}} \
|
||||
// expected-warning{{expecting mutex 'sls_mu' to be locked at start of each loop}}
|
||||
while(getBool()) {
|
||||
sls_mu.Unlock();
|
||||
|
@ -290,7 +290,7 @@ void aa_fun_bad_2() {
|
|||
|
||||
void aa_fun_bad_3() {
|
||||
glock.globalLock(); // \
|
||||
// expected-warning{{mutex 'aa_mu' is still locked at the end of function 'aa_fun_bad_3'}}
|
||||
// expected-warning{{mutex 'aa_mu' is still locked at the end of function}}
|
||||
}
|
||||
|
||||
//--------------------------------------------------//
|
||||
|
@ -303,19 +303,19 @@ Mutex wmu;
|
|||
class WeirdMethods {
|
||||
WeirdMethods() {
|
||||
wmu.Lock(); // \
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function 'WeirdMethods'}}
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function}}
|
||||
}
|
||||
~WeirdMethods() {
|
||||
wmu.Lock(); // \
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function '~WeirdMethods'}}
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function}}
|
||||
}
|
||||
void operator++() {
|
||||
wmu.Lock(); // \
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function 'operator++'}}
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function}}
|
||||
}
|
||||
operator int*() {
|
||||
wmu.Lock(); // \
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function 'operator int *'}}
|
||||
// expected-warning {{mutex 'wmu' is still locked at the end of function}}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -686,7 +686,7 @@ int slf_function_bad_7() __attribute__((shared_lock_function(0))); // \
|
|||
// plus an optional list of locks (vars/fields)
|
||||
|
||||
void etf_function() __attribute__((exclusive_trylock_function)); // \
|
||||
// expected-error {{attribute takes attribute takes at least 1 argument arguments}}
|
||||
// expected-error {{attribute takes at least 1 argument}}
|
||||
|
||||
void etf_function_args() __attribute__((exclusive_trylock_function(1, mu2)));
|
||||
|
||||
|
|
|
@ -189,13 +189,13 @@ void test7_unsafe(void) {
|
|||
- (id) init50 { return 0; }
|
||||
|
||||
- (void) init01 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}} \
|
||||
// expected-warning{{ method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
|
||||
// expected-warning{{method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
|
||||
- (void) init11 {}
|
||||
- (void) init21 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}}
|
||||
- (void) init31 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}} \
|
||||
// expected-warning{{ method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
|
||||
// expected-warning{{method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
|
||||
- (void) init41 {} // expected-error {{method was declared as an 'init' method, but its implementation doesn't match because its result type is not an object pointer}} \
|
||||
// expected-warning{{ method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
|
||||
// expected-warning{{method is expected to return an instance of its class type 'Test8', but is declared to return 'void'}}
|
||||
- (void) init51 {}
|
||||
|
||||
- (Test8_incomplete*) init02 { return 0; } // expected-error {{init methods must return a type related to the receiver type}} \
|
||||
|
@ -403,7 +403,7 @@ struct Test19 *const test19b = 0;
|
|||
void test19(void) {
|
||||
id x;
|
||||
x = (id) test19a; // expected-error {{bridged cast}} \
|
||||
// expected-note{{use __bridge to convert directly (no change in ownership))}} \
|
||||
// expected-note{{use __bridge to convert directly (no change in ownership)}} \
|
||||
// expected-note{{use __bridge_transfer to transfer ownership of a +1 'struct Test19 *' into ARC}}
|
||||
x = (id) test19b; // expected-error {{bridged cast}} \
|
||||
// expected-note{{use __bridge to convert directly (no change in ownership)}} \
|
||||
|
|
|
@ -77,8 +77,8 @@ void t4(Class c)
|
|||
|
||||
int t5() {
|
||||
Bar *f;
|
||||
f.FooBar = 1; // expected-warning {{warning: 'FooBar' is deprecated}}
|
||||
return f.FooBar; // expected-warning {{warning: 'FooBar' is deprecated}}
|
||||
f.FooBar = 1; // expected-warning {{'FooBar' is deprecated}}
|
||||
return f.FooBar; // expected-warning {{'FooBar' is deprecated}}
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,10 +99,10 @@ __attribute ((deprecated))
|
|||
@interface DEPRECATED (Category2) // no warning.
|
||||
@end
|
||||
|
||||
@implementation DEPRECATED (Category2) // expected-warning {{warning: 'DEPRECATED' is deprecated}}
|
||||
@implementation DEPRECATED (Category2) // expected-warning {{'DEPRECATED' is deprecated}}
|
||||
@end
|
||||
|
||||
@interface NS : DEPRECATED // expected-warning {{warning: 'DEPRECATED' is deprecated}}
|
||||
@interface NS : DEPRECATED // expected-warning {{'DEPRECATED' is deprecated}}
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -45,10 +45,10 @@ void foo7(id (^x)(int)) {
|
|||
@end
|
||||
|
||||
void foo8() {
|
||||
void *P = ^(itf x) {}; // expected-error {{Objective-C interface type 'itf' cannot be passed by value; did you forget * in 'itf'}}
|
||||
P = ^itf(int x) {}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
P = ^itf() {}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
P = ^itf{}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
void *P = ^(itf x) {}; // expected-error {{interface type 'itf' cannot be passed by value; did you forget * in 'itf'}}
|
||||
P = ^itf(int x) {}; // expected-error {{interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
P = ^itf() {}; // expected-error {{interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
P = ^itf{}; // expected-error {{interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@ id objc_getClass(const char *s);
|
|||
}
|
||||
- (int) instance_func1
|
||||
{
|
||||
int i = (size_t)[self instance_func0]; // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id'))}}
|
||||
return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0')}}
|
||||
int i = (size_t)[self instance_func0]; // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id')}}
|
||||
return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0'}}
|
||||
}
|
||||
- (int) instance_func2
|
||||
{
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
@interface MultipleCat_I() <MultipleCat_P> @end
|
||||
|
||||
@implementation MultipleCat_I // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
||||
// expected-warning {{method in protocol not implemented}}
|
||||
@end
|
||||
|
||||
// <rdar://problem/7680391> - Handle nameless categories with no name that refer
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
@interface Foo
|
||||
- (int) garf; // expected-note {{ previous declaration is here}}
|
||||
- (int) garf; // expected-note {{previous declaration is here}}
|
||||
- (int) OK;
|
||||
+ (int) cgarf; // expected-note {{ previous declaration is here}}
|
||||
+ (int) cgarf; // expected-note {{previous declaration is here}}
|
||||
- (int) InstMeth;
|
||||
@end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ extern NSString * const NSTaskDidTerminateNotification;
|
|||
@end
|
||||
|
||||
@implementation XCPropertyExpansionContext // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
||||
// expected-warning {{method in protocol not implemented}}
|
||||
- (NSString *)expandedValueForProperty:(NSString *)property {
|
||||
id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}
|
||||
if (cachedValueNode == ((void *)0)) { }
|
||||
|
|
|
@ -42,7 +42,7 @@ int main()
|
|||
MyProtocol), but not from an 'id' or from a 'MyOtherClass *'
|
||||
(which implements MyProtocol). */
|
||||
obj_p = obj; /* Ok */
|
||||
obj_p = obj_c; // expected-warning {{ assigning to 'id<MyProtocol>' from incompatible type 'MyClass *'}}
|
||||
obj_p = obj_c; // expected-warning {{assigning to 'id<MyProtocol>' from incompatible type 'MyClass *'}}
|
||||
obj_p = obj_cp; /* Ok */
|
||||
obj_p = obj_C; // expected-warning {{incompatible pointer types assigning to 'id<MyProtocol>' from 'Class'}}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ int main()
|
|||
obj = j; // expected-warning {{incompatible pointer types assigning to 'id' from 'int *'}}
|
||||
|
||||
obj_p = i; // expected-warning {{incompatible integer to pointer conversion assigning to 'id<MyProtocol>' from 'int'}}
|
||||
obj_p = j; // expected-warning {{ incompatible pointer types assigning to 'id<MyProtocol>' from 'int *'}}
|
||||
obj_p = j; // expected-warning {{incompatible pointer types assigning to 'id<MyProtocol>' from 'int *'}}
|
||||
|
||||
obj_c = i; // expected-warning {{incompatible integer to pointer conversion assigning to 'MyClass *' from 'int'}}
|
||||
obj_c = j; // expected-warning {{incompatible pointer types assigning to 'MyClass *' from 'int *'}}
|
||||
|
@ -42,7 +42,7 @@ int main()
|
|||
i = obj_C; // expected-warning {{incompatible pointer to integer conversion assigning to 'int' from 'Class'}}
|
||||
|
||||
j = obj; // expected-warning {{incompatible pointer types assigning to 'int *' from 'id'}}
|
||||
j = obj_p; // expected-warning {{ incompatible pointer types assigning to 'int *' from 'id<MyProtocol>'}}
|
||||
j = obj_p; // expected-warning {{incompatible pointer types assigning to 'int *' from 'id<MyProtocol>'}}
|
||||
j = obj_c; // expected-warning {{incompatible pointer types assigning to 'int *' from 'MyClass *'}}
|
||||
j = obj_C; // expected-warning {{incompatible pointer types assigning to 'int *' from 'Class'}}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ void f2(id<P1> x) {
|
|||
}
|
||||
|
||||
void f3(A *a) {
|
||||
id<P1> l = a; // expected-warning {{ initializing 'id<P1>' with an expression of incompatible type 'A *'}}
|
||||
id<P1> l = a; // expected-warning {{initializing 'id<P1>' with an expression of incompatible type 'A *'}}
|
||||
}
|
||||
|
||||
void f4(int cond, id x, A *a) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
@end
|
||||
|
||||
@interface DTFilterOutputStream2
|
||||
- nextOutputStream; // expected-note {{{{method definition for 'nextOutputStream' not found}}
|
||||
- nextOutputStream; // expected-note {{method definition for 'nextOutputStream' not found}}
|
||||
@end
|
||||
|
||||
@implementation DTFilterOutputStream2 // expected-warning {{incomplete implementation}}
|
||||
|
@ -100,7 +100,7 @@ void f8(int a, A<P0> *x, A *y) {
|
|||
}
|
||||
|
||||
void f9(int a, A<P0> *x, A<P1> *y) {
|
||||
id l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')'}}
|
||||
id l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
|
||||
A<P0> *l1 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
|
||||
A<P1> *l2 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
|
||||
[ (a ? x : y ) intProp ]; // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}}
|
||||
|
|
|
@ -5,8 +5,8 @@ typedef struct _NSRange { } NSRange;
|
|||
@class PBXFileReference;
|
||||
|
||||
@interface PBXDocBookmark
|
||||
+ alloc; // expected-note {{{{method definition for 'alloc' not found}}
|
||||
- autorelease; // expected-note {{{{method definition for 'autorelease' not found}}
|
||||
+ alloc; // expected-note {{method definition for 'alloc' not found}}
|
||||
- autorelease; // expected-note {{method definition for 'autorelease' not found}}
|
||||
@end
|
||||
|
||||
// GCC allows pointer expressions in integer constant expressions.
|
||||
|
|
|
@ -27,8 +27,8 @@ struct whatever {
|
|||
}
|
||||
@end
|
||||
|
||||
Super foo( // expected-error{{interface interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
|
||||
Super parm1) { // expected-error{{interface interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
|
||||
Super foo( // expected-error{{interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
|
||||
Super parm1) { // expected-error{{interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
|
||||
Super p1; // expected-error{{interface type cannot be statically allocated}}
|
||||
return p1;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ extern struct foo x;
|
|||
|
||||
@implementation A
|
||||
- (int*)method {
|
||||
int *ip = [Ivar method]; // expected-warning{{warning: incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
|
||||
int *ip = [Ivar method]; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
|
||||
// Note that there is no warning in Objective-C++
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -7,21 +7,21 @@
|
|||
@end
|
||||
|
||||
@interface bar
|
||||
-(void) my_method:(foo) my_param; // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
- (foo)cccccc:(long)ddddd; // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
-(void) my_method:(foo) my_param; // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
- (foo)cccccc:(long)ddddd; // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
@end
|
||||
|
||||
@implementation bar
|
||||
-(void) my_method:(foo) my_param // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
-(void) my_method:(foo) my_param // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
{
|
||||
}
|
||||
- (foo)cccccc:(long)ddddd // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
- (foo)cccccc:(long)ddddd // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
void somefunc(foo x) {} // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
foo somefunc2() {} // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
void somefunc(foo x) {} // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
foo somefunc2() {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
|
||||
// rdar://6780761
|
||||
void f0(foo *a0) {
|
||||
|
|
|
@ -9,5 +9,5 @@ void test() {
|
|||
|
||||
[[Foo alloc] init]; // expected-warning {{class method '+alloc' not found (return type defaults to 'id')}} expected-warning {{instance method '-init' not found (return type defaults to 'id')}}
|
||||
[fooObj notdefined]; // expected-warning {{instance method '-notdefined' not found (return type defaults to 'id')}}
|
||||
[obj whatever:1 :2 :3]; // expected-warning {{instance method '-whatever:::' not found (return type defaults to 'id'))}}
|
||||
[obj whatever:1 :2 :3]; // expected-warning {{instance method '-whatever:::' not found (return type defaults to 'id')}}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
@end
|
||||
|
||||
@protocol P
|
||||
- (void) Pmeth; // expected-note {{method declared here }}
|
||||
- (void) Pmeth1; // expected-note {{method declared here }}
|
||||
- (void) Pmeth; // expected-note {{method declared here}}
|
||||
- (void) Pmeth1; // expected-note {{method declared here}}
|
||||
@end
|
||||
|
||||
@interface MyClass1(CAT) <P> // expected-note {{required for direct or indirect protocol 'P'}}
|
||||
|
@ -13,7 +13,7 @@
|
|||
@end
|
||||
|
||||
@implementation MyClass1(CAT) // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
||||
// expected-warning {{method in protocol not implemented}}
|
||||
- (void) Pmeth1{}
|
||||
@end
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
@end
|
||||
|
||||
@implementation MyClass1(DOG) // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
||||
// expected-warning {{method in protocol not implemented}}
|
||||
- (void) Pmeth {}
|
||||
@end
|
||||
|
||||
|
|
|
@ -19,6 +19,6 @@
|
|||
@end
|
||||
|
||||
@implementation MyClass // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
||||
// expected-warning {{method in protocol not implemented}}
|
||||
- (void)Pmeth {}
|
||||
@end
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
// rdar://9615045
|
||||
|
||||
@interface I
|
||||
- initWithFoo:(id)foo; // expected-warning {{method has no return type specified; defaults to 'id' [-Wmissing-method-return-type]}}
|
||||
- initWithFoo:(id)foo; // expected-warning {{method has no return type specified; defaults to 'id'}}
|
||||
@end
|
||||
|
||||
@implementation I
|
||||
- initWithFoo:(id)foo { return 0; } // expected-warning {{method has no return type specified; defaults to 'id' [-Wmissing-method-return-type]}}
|
||||
- initWithFoo:(id)foo { return 0; } // expected-warning {{method has no return type specified; defaults to 'id'}}
|
||||
@end
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
// Test2
|
||||
@interface super - PMeth; @end
|
||||
@interface J : super <P>
|
||||
- PMeth; // expected-note {{ method definition for 'PMeth' not found}}
|
||||
- PMeth; // expected-note {{method definition for 'PMeth' not found}}
|
||||
@end
|
||||
@implementation J @end // expected-warning {{incomplete implementation}}
|
||||
|
||||
|
|
|
@ -51,14 +51,14 @@ typedef signed char BOOL;
|
|||
|
||||
// test parser recovery: rdar://6254579
|
||||
@property ( // expected-note {{to match this '('}}
|
||||
readonly getter=isAwesome) // expected-error {{error: expected ')'}}
|
||||
readonly getter=isAwesome) // expected-error {{expected ')'}}
|
||||
|
||||
int _awesome;
|
||||
@property (readonlyx) // expected-error {{unknown property attribute 'readonlyx'}}
|
||||
int _awesome2;
|
||||
|
||||
@property ( // expected-note {{to match this '('}}
|
||||
+) // expected-error {{error: expected ')'}}
|
||||
+) // expected-error {{expected ')'}}
|
||||
|
||||
int _awesome3;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ extern id NSApp;
|
|||
|
||||
- (void)startFSEventGathering:(id)sender
|
||||
{
|
||||
fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{warning: instance method '-delegate' not found (return type defaults to 'id')}} \
|
||||
fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{instance method '-delegate' not found (return type defaults to 'id')}} \
|
||||
// expected-error {{property 'fsEventStream' not found on object of type 'id'}}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
@class A, B, C;
|
||||
|
||||
void test1() {
|
||||
goto L; // expected-error{{illegal goto into protected scope}}
|
||||
goto L2; // expected-error{{illegal goto into protected scope}}
|
||||
goto L3; // expected-error{{illegal goto into protected scope}}
|
||||
goto L; // expected-error{{goto into protected scope}}
|
||||
goto L2; // expected-error{{goto into protected scope}}
|
||||
goto L3; // expected-error{{goto into protected scope}}
|
||||
@try { // expected-note {{jump bypasses initialization of @try block}}
|
||||
L: ;
|
||||
} @catch (A *x) { // expected-note {{jump bypasses initialization of @catch block}}
|
||||
|
@ -17,11 +17,11 @@ L3: ;
|
|||
}
|
||||
|
||||
@try {
|
||||
goto L4; // expected-error{{illegal goto into protected scope}}
|
||||
goto L5; // expected-error{{illegal goto into protected scope}}
|
||||
goto L4; // expected-error{{goto into protected scope}}
|
||||
goto L5; // expected-error{{goto into protected scope}}
|
||||
} @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
|
||||
L5: ;
|
||||
goto L6; // expected-error{{illegal goto into protected scope}}
|
||||
goto L6; // expected-error{{goto into protected scope}}
|
||||
} @catch (B *c) { // expected-note {{jump bypasses initialization of @catch block}}
|
||||
L6: ;
|
||||
} @finally { // expected-note {{jump bypasses initialization of @finally block}}
|
||||
|
@ -32,12 +32,12 @@ L3: ;
|
|||
@try { // expected-note 2 {{jump bypasses initialization of @try block}}
|
||||
L7: ;
|
||||
} @catch (C *c) {
|
||||
goto L7; // expected-error{{illegal goto into protected scope}}
|
||||
goto L7; // expected-error{{goto into protected scope}}
|
||||
} @finally {
|
||||
goto L7; // expected-error{{illegal goto into protected scope}}
|
||||
goto L7; // expected-error{{goto into protected scope}}
|
||||
}
|
||||
|
||||
goto L8; // expected-error{{illegal goto into protected scope}}
|
||||
goto L8; // expected-error{{goto into protected scope}}
|
||||
@try {
|
||||
} @catch (A *c) {
|
||||
} @catch (B *c) {
|
||||
|
@ -47,7 +47,7 @@ L3: ;
|
|||
|
||||
// rdar://6810106
|
||||
id X;
|
||||
goto L9; // expected-error{{illegal goto into protected scope}}
|
||||
goto L9; // expected-error{{goto into protected scope}}
|
||||
goto L10; // ok
|
||||
@synchronized // expected-note {{jump bypasses initialization of @synchronized block}}
|
||||
( ({ L10: ; X; })) {
|
||||
|
@ -79,7 +79,7 @@ void test3() {
|
|||
+ (void) hello {
|
||||
|
||||
@try {
|
||||
goto blargh; // expected-error {{illegal goto into protected scope}}
|
||||
goto blargh; // expected-error {{goto into protected scope}}
|
||||
} @catch (...) { // expected-note {{jump bypasses initialization of @catch block}}
|
||||
blargh: ;
|
||||
}
|
||||
|
@ -87,14 +87,14 @@ void test3() {
|
|||
|
||||
+ (void)meth2 {
|
||||
int n; void *P;
|
||||
goto L0; // expected-error {{illegal goto into protected scope}}
|
||||
goto L0; // expected-error {{goto into protected scope}}
|
||||
typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}}
|
||||
L0:
|
||||
|
||||
goto L1; // expected-error {{illegal goto into protected scope}}
|
||||
goto L1; // expected-error {{goto into protected scope}}
|
||||
A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}}
|
||||
L1:
|
||||
goto L2; // expected-error {{illegal goto into protected scope}}
|
||||
goto L2; // expected-error {{goto into protected scope}}
|
||||
A d[n]; // expected-note {{jump bypasses initialization of variable length array}}
|
||||
L2:
|
||||
return;
|
||||
|
|
|
@ -50,6 +50,6 @@ __attribute ((deprecated))
|
|||
@end
|
||||
|
||||
void foo() {
|
||||
[DEPRECATED new]; // expected-warning {{warning: 'DEPRECATED' is deprecated}}
|
||||
[DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ void takevoidptr(void*);
|
|||
@implementation B
|
||||
|
||||
- (void)instanceMethod {
|
||||
[super iMethod]; // expected-warning{{'A' may not respond to 'iMethod')}}
|
||||
[super iMethod]; // expected-warning{{'A' may not respond to 'iMethod'}}
|
||||
|
||||
// Use of super in a block is ok and does codegen to the right thing.
|
||||
// rdar://7852959
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef struct _NSZone NSZone;
|
|||
int foo() {
|
||||
struct s { int a, b; } agg, *pagg;
|
||||
|
||||
@throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid))}}
|
||||
@throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}}
|
||||
@throw agg; // expected-error {{@throw requires an Objective-C object type ('struct s' invalid)}}
|
||||
@throw pagg; // expected-error {{@throw requires an Objective-C object type ('struct s *' invalid)}}
|
||||
@throw; // expected-error {{@throw (rethrow) used outside of a @catch block}}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
@end
|
||||
|
||||
@implementation INTF // expected-warning {{incomplete implementation}} \
|
||||
// expected-warning 9 {{method in protocol not implemented [-Wprotocol}}
|
||||
// expected-warning 9 {{method in protocol not implemented}}
|
||||
- (void) DefP1proto{}
|
||||
|
||||
+ (void) DefClsP3Proto{}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue