1 // RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -pedantic -Wno-objc-root-class %s
2 // RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-c99-designator -Wno-objc-root-class %s
3 // RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-c99-designator -Wno-objc-root-class -std=c++98 %s
4 // RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-c99-designator -Wno-objc-root-class -std=c++11 %s
17 id objects[] = {[NSNumber METH]};
20 void test2(NSNumber x) { // expected-error {{interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
21 id objects[] = {[x METH]};
24 void test3(NSNumber *x) {
25 id objects[] = {[x METH]};
31 unsigned x[] = {[NSNumber METH2]+2};
34 void test5(NSNumber *x) {
36 [4][NSNumber METH2]+2, // expected-warning {{use of GNU 'missing =' extension in designator}}
37 [4][x METH2]+2 // expected-warning {{use of GNU 'missing =' extension in designator}}
40 struct SomeStruct z = {
41 .x = [x METH2], // ok in C++98.
42 #if __cplusplus >= 201103L
43 // expected-error@-2 {{non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list}}
44 // expected-note@-3 {{insert an explicit cast to silence this issue}}
46 .x [x METH2] // expected-error {{expected '=' or another designator}}
47 #if __cplusplus >= 201103L
48 // expected-error@-2 {{non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list}}
49 // expected-note@-3 {{insert an explicit cast to silence this issue}}
55 @interface SemicolonsAppDelegate
59 @property (assign) id window;
62 @implementation SemicolonsAppDelegate