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
16 id objects[] = {[NSNumber METH]};
19 void test2(NSNumber x) { // expected-error {{interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
20 id objects[] = {[x METH]};
23 void test3(NSNumber *x) {
24 id objects[] = {[x METH]};
29 unsigned x[] = {[NSNumber METH2]+2};
32 void test5(NSNumber *x) {
34 [4][NSNumber METH2]+2, // expected-warning {{use of GNU 'missing =' extension in designator}}
35 [4][x METH2]+2 // expected-warning {{use of GNU 'missing =' extension in designator}}
38 struct SomeStruct z = {
39 .x = [x METH2], // ok in C++98.
40 #if __cplusplus >= 201103L
41 // expected-error@-2 {{non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list}}
42 // expected-note@-3 {{insert an explicit cast to silence this issue}}
44 .x [x METH2] // expected-error {{expected '=' or another designator}}
45 #if __cplusplus >= 201103L
46 // expected-error@-2 {{non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list}}
47 // expected-note@-3 {{insert an explicit cast to silence this issue}}
52 @interface SemicolonsAppDelegate
56 @property (assign) id window;
59 @implementation SemicolonsAppDelegate