2 changes: 1 addition & 1 deletion clang/test/Misc/diag-macro-backtrace2.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void PR16799() {
const char str[] = "string";
a(str);
// CHECK: :15:3: error: invalid operands to binary expression
// CHECK: ('const char [7]' and 'int')
// CHECK: ('const char[7]' and 'int')
// CHECK: a(str);
// CHECK: ^~~~~~
// CHECK: :3:11: note: expanded from macro 'a'
Expand Down
16 changes: 8 additions & 8 deletions clang/test/Misc/integer-literal-printing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ void Function() {
Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}}
Function2(Type2<42>()); // expected-error{{no matching function for call to 'Function2'}}

struct Type3<boolTy::b, "3"> t3; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type3Helper<(boolTy)false>::Ty' (aka 'boolTy')}}

struct Type4<charTy::c, "4"> t4; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type4Helper<(charTy)'\x00'>::Ty' (aka 'charTy')}}
struct Type5<scharTy::c, "5"> t5; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type5Helper<(scharTy)'\x00'>::Ty' (aka 'scharTy')}}
struct Type6<ucharTy::c, "6"> t6; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type6Helper<(ucharTy)'\x00'>::Ty' (aka 'ucharTy')}}
struct Type7<wcharTy::c, "7"> t7; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type7Helper<(wcharTy)L'\x00'>::Ty' (aka 'wcharTy')}}
struct Type8<char16Ty::c, "8"> t8; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type8Helper<(char16Ty)u'\x00'>::Ty' (aka 'char16Ty')}}
struct Type9<char32Ty::c, "9"> t9; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type9Helper<(char32Ty)u'\x00'>::Ty' (aka 'char32Ty')}}
struct Type3<boolTy::b, "3"> t3; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type3Helper<(boolTy)false>::Ty' (aka 'boolTy')}}

struct Type4<charTy::c, "4"> t4; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type4Helper<(charTy)'\x00'>::Ty' (aka 'charTy')}}
struct Type5<scharTy::c, "5"> t5; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type5Helper<(scharTy)'\x00'>::Ty' (aka 'scharTy')}}
struct Type6<ucharTy::c, "6"> t6; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type6Helper<(ucharTy)'\x00'>::Ty' (aka 'ucharTy')}}
struct Type7<wcharTy::c, "7"> t7; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type7Helper<(wcharTy)L'\x00'>::Ty' (aka 'wcharTy')}}
struct Type8<char16Ty::c, "8"> t8; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type8Helper<(char16Ty)u'\x00'>::Ty' (aka 'char16Ty')}}
struct Type9<char32Ty::c, "9"> t9; // expected-error{{value of type 'const char[2]' is not implicitly convertible to 'typename Type9Helper<(char32Ty)u'\x00'>::Ty' (aka 'char32Ty')}}
}
8 changes: 4 additions & 4 deletions clang/test/Modules/cxx-templates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ namespace Std {

// CHECK-DUMP: ClassTemplateDecl {{.*}} <{{.*[/\\]}}cxx-templates-common.h:1:1, {{.*}}> col:{{.*}} in cxx_templates_common SomeTemplate
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} prev {{.*}} SomeTemplate
// CHECK-DUMP-NEXT: TemplateArgument type 'char [2]'
// CHECK-DUMP-NEXT: TemplateArgument type 'char[2]'
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} SomeTemplate definition
// CHECK-DUMP-NEXT: DefinitionData
// CHECK-DUMP-NEXT: DefaultConstructor
Expand All @@ -260,9 +260,9 @@ namespace Std {
// CHECK-DUMP-NEXT: CopyAssignment
// CHECK-DUMP-NEXT: MoveAssignment
// CHECK-DUMP-NEXT: Destructor
// CHECK-DUMP-NEXT: TemplateArgument type 'char [2]'
// CHECK-DUMP-NEXT: TemplateArgument type 'char[2]'
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} prev {{.*}} SomeTemplate
// CHECK-DUMP-NEXT: TemplateArgument type 'char [1]'
// CHECK-DUMP-NEXT: TemplateArgument type 'char[1]'
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} SomeTemplate definition
// CHECK-DUMP-NEXT: DefinitionData
// CHECK-DUMP-NEXT: DefaultConstructor
Expand All @@ -271,4 +271,4 @@ namespace Std {
// CHECK-DUMP-NEXT: CopyAssignment
// CHECK-DUMP-NEXT: MoveAssignment
// CHECK-DUMP-NEXT: Destructor
// CHECK-DUMP-NEXT: TemplateArgument type 'char [1]'
// CHECK-DUMP-NEXT: TemplateArgument type 'char[1]'
8 changes: 4 additions & 4 deletions clang/test/Modules/odr_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ struct S14 {
};
#else
S14 s14;
// expected-error@second.h:* {{'Method::S14' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int [3]'}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int [2]'}}
// expected-error@second.h:* {{'Method::S14' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int[3]'}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int[2]'}}
#endif

#if defined(FIRST)
Expand Down Expand Up @@ -4533,8 +4533,8 @@ int F9(int[1]) { return 0; }
int F9(int[2]) { return 0; }
#else
int I9 = F9(nullptr);
// expected-error@second.h:* {{'FunctionDecl::F9' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with type 'int *' decayed from 'int [2]'}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with type 'int *' decayed from 'int [1]'}}
// expected-error@second.h:* {{'FunctionDecl::F9' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with type 'int *' decayed from 'int[2]'}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with type 'int *' decayed from 'int[1]'}}
#endif

#if defined(FIRST)
Expand Down
4 changes: 2 additions & 2 deletions clang/test/OpenMP/distribute_firstprivate_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ int main(int argc, char **argv) {
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute firstprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute firstprivate(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ int main(int argc, char **argv) {
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for firstprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for firstprivate(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for firstprivate(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for firstprivate(ca) // expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ int main(int argc, char **argv) {
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for lastprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for lastprivate(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ int main(int argc, char **argv) {
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ T tmain(T argc, S **argv) {

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
Expand Down Expand Up @@ -305,14 +305,14 @@ int main(int argc, char **argv) {

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ int main(int argc, char **argv) {
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute simd firstprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute simd firstprivate(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute simd firstprivate(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute simd firstprivate(ca) // expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
Expand Down
4 changes: 2 additions & 2 deletions clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ int main(int argc, char **argv) {
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute simd lastprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute simd lastprivate(ba) // expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
Expand Down
4 changes: 2 additions & 2 deletions clang/test/OpenMP/distribute_simd_reduction_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,12 @@ int main(int argc, char **argv) {
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
#pragma omp distribute simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp distribute simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/parallel_reduction_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void test(int *p) {
;
#pragma omp parallel reduction(inscan, + : a) // expected-error {{'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd', 'omp parallel for', or 'omp parallel for simd' directive}}
;
#pragma omp parallel reduction(+ : incomplete, ([10])p) // expected-error {{a reduction list item with incomplete type 'int []'}} expected-error {{expected variable name, array element or array section}}
#pragma omp parallel reduction(+ : incomplete, ([10])p) // expected-error {{a reduction list item with incomplete type 'int[]'}} expected-error {{expected variable name, array element or array section}}
;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main(int argc, char **argv) {
for (i = 0; i < argc; ++i) foo();

#pragma omp target
#pragma omp teams distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp teams distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Type 'const S3[5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();

#pragma omp target teams distribute firstprivate(da, z)
Expand Down
2 changes: 1 addition & 1 deletion clang/test/PCH/objc_exprs.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
int *A1 = (objc_string)0; // expected-warning {{aka 'NSString *'}}

char A2 = (objc_encode){}; // expected-error {{not a compile-time constant}} \
expected-warning {{char [2]}}
expected-warning {{char[2]}}

int *A3 = (objc_protocol)0; // expected-warning {{aka 'Protocol *'}}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/Parser/atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef int int_fn();
typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int ()')}} \
// ext-warning {{'_Atomic' is a C11 extension}}
typedef _Atomic int atomic_int_array[3]; // ext-warning {{'_Atomic' is a C11 extension}}
typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int) [3]')}} \
typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int)[3]')}} \
// ext-warning {{'_Atomic' is a C11 extension}}

_Atomic struct S { int n; }; // expected-warning {{'_Atomic' ignored on this declaration}} \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/array-constraint.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef int TA[I]; // expected-error {{variable length array declaration not all
void strFunc(char *); // expected-note{{passing argument to parameter here}}
const char staticAry[] = "test";
void checkStaticAry() {
strFunc(staticAry); // expected-warning{{passing 'const char [5]' to parameter of type 'char *' discards qualifiers}}
strFunc(staticAry); // expected-warning{{passing 'const char[5]' to parameter of type 'char *' discards qualifiers}}
}


28 changes: 14 additions & 14 deletions clang/test/Sema/array-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int ary2[] = { x, y, z }; // expected-error{{initializer element is not a compil

extern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}}

static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}}
static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char[4]'}}

void func() {
int x = 1;
Expand Down Expand Up @@ -51,7 +51,7 @@ void func() {
extern int blockScopeExtern[3] = { 1, 3, 5 }; // expected-error{{'extern' variable cannot have an initializer}}

static long x2[3] = { 1.0,
"abc", // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}}
"abc", // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char[4]'}}
5.8 }; // expected-warning {{implicit conversion from 'double' to 'long' changes value from 5.8 to 5}}
}

Expand Down Expand Up @@ -114,12 +114,12 @@ int legal2() {
}

void illegal() {
short q2[4][][2] = { // expected-error{{array has incomplete element type 'short [][2]'}}
short q2[4][][2] = { // expected-error{{array has incomplete element type 'short[][2]'}}
{ 1, 0, 0, 0, 0, 0 },
{ 2, 3, 0, 0, 0, 0 },
{ 4, 5, 6 }
};
short q3[4][3][] = { // expected-error{{array has incomplete element type 'short []'}}
short q3[4][3][] = { // expected-error{{array has incomplete element type 'short[]'}}
{
{ 1 },
},
Expand All @@ -131,7 +131,7 @@ void illegal() {
{ 6 },
},
};
int a[][] = { 1, 2 }; // expected-error{{array has incomplete element type 'int []'}}
int a[][] = { 1, 2 }; // expected-error{{array has incomplete element type 'int[]'}}
}

typedef int AryT[];
Expand Down Expand Up @@ -168,10 +168,10 @@ void charArrays() {
char c[] = { "Hello" };
int l[sizeof(c) == 6 ? 1 : -1];

int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [7]'}}
int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char[7]'}}
char c2[] = { "Hello", "Good bye" }; //expected-warning{{excess elements in char array initializer}}

int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [6]'}}
int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char[6]'}}
char c3[5] = { "Hello" };
char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}}

Expand Down Expand Up @@ -204,7 +204,7 @@ void autoStructTest() {
struct s1 {char a; char b;} t1;
struct s2 {struct s1 c;} t2 = { t1 };
// The following is a less than great diagnostic (though it's on par with EDG).
struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [4]'}}
struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' with an expression of type 'char[4]'}}
int t4[sizeof t3 == 6 ? 1 : -1];
}
struct foo { int z; } w;
Expand Down Expand Up @@ -282,13 +282,13 @@ char badchararray[1] = { badchararray[0], "asdf" }; // expected-warning {{excess
// Test the GNU extension for initializing an array from an array
// compound literal. PR9261.
typedef int int5[5];
int a1[5] = (int[]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int [5]' from a compound literal of type 'int [5]' is a GNU extension}}
int a2[5] = (int[5]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int [5]' from a compound literal of type 'int [5]' is a GNU extension}}
int a3[] = ((int[]){1, 2, 3, 4, 5}); // expected-warning{{initialization of an array of type 'int []' from a compound literal of type 'int [5]' is a GNU extension}}
int a4[] = (int[5]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int []' from a compound literal of type 'int [5]' is a GNU extension}}
int a5[] = (int5){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int []' from a compound literal of type 'int5' (aka 'int [5]') is a GNU extension}}
int a1[5] = (int[]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int[5]' from a compound literal of type 'int[5]' is a GNU extension}}
int a2[5] = (int[5]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int[5]' from a compound literal of type 'int[5]' is a GNU extension}}
int a3[] = ((int[]){1, 2, 3, 4, 5}); // expected-warning{{initialization of an array of type 'int[]' from a compound literal of type 'int[5]' is a GNU extension}}
int a4[] = (int[5]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int[]' from a compound literal of type 'int[5]' is a GNU extension}}
int a5[] = (int5){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int[]' from a compound literal of type 'int5' (aka 'int[5]') is a GNU extension}}

int a6[5] = (int[]){1, 2, 3}; // expected-error{{cannot initialize array of type 'int [5]' with array of type 'int [3]'}}
int a6[5] = (int[]){1, 2, 3}; // expected-error{{cannot initialize array of type 'int[5]' with array of type 'int[3]'}}

int nonconst_value();
int a7[5] = (int[5]){ 1,
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Sema/assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ typedef int arr[10];
void test3() {
const arr b; // expected-note {{variable 'b' declared const here}}
const int b2[10]; // expected-note {{variable 'b2' declared const here}}
b[4] = 1; // expected-error {{cannot assign to variable 'b' with const-qualified type 'const arr' (aka 'const int [10]')}}
b2[4] = 1; // expected-error {{cannot assign to variable 'b2' with const-qualified type 'const int [10]'}}
b[4] = 1; // expected-error {{cannot assign to variable 'b' with const-qualified type 'const arr' (aka 'const int[10]')}}
b2[4] = 1; // expected-error {{cannot assign to variable 'b2' with const-qualified type 'const int[10]'}}
}

typedef struct I {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/builtin-expect-with-probability-avr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void test(int x, double p) { // expected-note {{declared here}}
dummy = __builtin_expect_with_probability(x > 0, 1, 1.1); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, -1); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, p); // expected-error {{probability argument to __builtin_expect_with_probability must be constant floating-point expression}} expected-note {{function parameter 'p' with unknown value}}
dummy = __builtin_expect_with_probability(x > 0, 1, "aa"); // expected-error {{cannot initialize a parameter of type 'double' with an lvalue of type 'const char [3]'}}
dummy = __builtin_expect_with_probability(x > 0, 1, "aa"); // expected-error {{cannot initialize a parameter of type 'double' with an lvalue of type 'const char[3]'}}
dummy = __builtin_expect_with_probability(x > 0, 1, __builtin_nan("")); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, __builtin_inf()); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, -0.0);
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/builtin-expect-with-probability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void test(int x, double p) { // expected-note {{declared here}}
dummy = __builtin_expect_with_probability(x > 0, 1, 1.1); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, -1); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, p); // expected-error {{probability argument to __builtin_expect_with_probability must be constant floating-point expression}} expected-note {{function parameter 'p'}}
dummy = __builtin_expect_with_probability(x > 0, 1, "aa"); // expected-error {{cannot initialize a parameter of type 'double' with an lvalue of type 'const char [3]'}}
dummy = __builtin_expect_with_probability(x > 0, 1, "aa"); // expected-error {{cannot initialize a parameter of type 'double' with an lvalue of type 'const char[3]'}}
dummy = __builtin_expect_with_probability(x > 0, 1, __builtin_nan("")); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, __builtin_inf()); // expected-error {{probability argument to __builtin_expect_with_probability is outside the range [0.0, 1.0]}}
dummy = __builtin_expect_with_probability(x > 0, 1, -0.0);
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Sema/c11-typedef-redef.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ void f(int N) {
typedef int type2;

typedef int vla[N]; // expected-note{{previous definition is here}}
typedef int vla[N]; // expected-error{{redefinition of typedef for variably-modified type 'int [N]'}}
typedef int vla[N]; // expected-error{{redefinition of typedef for variably-modified type 'int[N]'}}

typedef int vla2[N];
typedef vla2 vla3; // expected-note{{previous definition is here}}
typedef vla2 vla3; // expected-error{{redefinition of typedef for variably-modified type 'vla2' (aka 'int [N]')}}
typedef vla2 vla3; // expected-error{{redefinition of typedef for variably-modified type 'vla2' (aka 'int[N]')}}
}
2 changes: 1 addition & 1 deletion clang/test/Sema/compound-literal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static int *p = (int []){2,4};
static int x = (int){1};

static int *p2 = (int []){2,x}; // expected-error {{initializer element is not a compile-time constant}}
static long *p3 = (long []){2,"x"}; // expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
static long *p3 = (long []){2,"x"}; // expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char[2]'}}

typedef struct { } cache_t; // expected-warning{{empty struct is a GNU extension}}
static cache_t clo_I1_cache = ((cache_t) { } ); // expected-warning{{use of GNU empty initializer extension}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/crash-invalid-array.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main()

for(i = 0; i < 10; ++i)
{
p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}}
p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int[]'}}
}
}

Expand Down
6 changes: 3 additions & 3 deletions clang/test/Sema/empty1.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ int func_7(struct A *x, struct A *y) {
}

int func_8(struct emp_1 (*x)[10], struct emp_1 (*y)[10]) {
return x - y; // expected-warning {{subtraction of pointers to type 'struct emp_1 [10]' of zero size has undefined behavior}}
return x - y; // expected-warning {{subtraction of pointers to type 'struct emp_1[10]' of zero size has undefined behavior}}
}

int func_9(struct emp_1 (*x)[], struct emp_1 (*y)[]) {
return x - y; // expected-error {{arithmetic on a pointer to an incomplete type 'struct emp_1 []'}}
return x - y; // expected-error {{arithmetic on a pointer to an incomplete type 'struct emp_1[]'}}
}

int func_10(int (*x)[0], int (*y)[0]) {
return x - y; // expected-warning {{subtraction of pointers to type 'int [0]' of zero size has undefined behavior}}
return x - y; // expected-warning {{subtraction of pointers to type 'int[0]' of zero size has undefined behavior}}
}
6 changes: 3 additions & 3 deletions clang/test/Sema/extern-redecl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ extern int test1_a[];
// rdar://13535367
void test2declarer() { extern int test2_array[100]; }
extern int test2_array[];
int test2v = sizeof(test2_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
int test2v = sizeof(test2_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int[]'}}

void test3declarer() {
{ extern int test3_array[100]; }
extern int test3_array[];
int x = sizeof(test3_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
int x = sizeof(test3_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int[]'}}
}

void test4() {
Expand All @@ -40,7 +40,7 @@ void test4() {
extern int test4_array[100];
int x = sizeof(test4_array); // fine
}
int x = sizeof(test4_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
int x = sizeof(test4_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int[]'}}
}

// Test that invalid local extern declarations of library
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/generic-selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void foo(int n) {
(void) _Generic(0, // ext-warning {{'_Generic' is a C11 extension}}
struct A: 0, // expected-error {{type 'struct A' in generic association incomplete}}
void(): 0, // expected-error {{type 'void ()' in generic association not an object type}}
int[n]: 0); // expected-error {{type 'int [n]' in generic association is a variably modified type}}
int[n]: 0); // expected-error {{type 'int[n]' in generic association is a variably modified type}}

(void) _Generic(0, // ext-warning {{'_Generic' is a C11 extension}}
void (*)(): 0, // expected-note {{compatible type 'void (*)()' specified here}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/gnu-flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void statementexp()


#if ALL || COMPOUNDLITERALINITIALIZER
// expected-warning@+4 {{initialization of an array of type 'int [5]' from a compound literal of type 'int [5]' is a GNU extension}}
// expected-warning@+4 {{initialization of an array of type 'int[5]' from a compound literal of type 'int[5]' is a GNU extension}}
#endif

typedef int int5[5];
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/incomplete-decl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void func() {
}

int h[]; // expected-warning {{tentative array definition assumed to have one element}}
int (*i)[] = &h+1; // expected-error {{arithmetic on a pointer to an incomplete type 'int []'}}
int (*i)[] = &h+1; // expected-error {{arithmetic on a pointer to an incomplete type 'int[]'}}

struct bar j = {1}; // expected-error {{variable has incomplete type 'struct bar'}} \
expected-note {{forward declaration of 'struct bar'}}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Sema/matrix-type-builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ void column_major_load(float *p1, int *p2, _Bool *p3, struct Foo *p4) {
10, // expected-error {{1st argument must be a pointer to a valid matrix element type}}
1ull << 21, // expected-error {{row dimension is outside the allowed range [1, 1048575]}}
1ull << 21, // expected-error {{column dimension is outside the allowed range [1, 1048575]}}
""); // expected-warning {{incompatible pointer to integer conversion casting 'char [1]' to type 'unsigned long'}}
""); // expected-warning {{incompatible pointer to integer conversion casting 'char[1]' to type 'unsigned long'}}

sx5x10_t a13 = __builtin_matrix_column_major_load(
10, // expected-error {{1st argument must be a pointer to a valid matrix element type}}
*p4, // expected-error {{casting 'struct Foo' to incompatible type 'unsigned long'}}
"", // expected-error {{column argument must be a constant unsigned integer expression}}
// expected-warning@-1 {{incompatible pointer to integer conversion casting 'char [1]' to type 'unsigned long'}}
// expected-warning@-1 {{incompatible pointer to integer conversion casting 'char[1]' to type 'unsigned long'}}
10);
}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/merge-decls.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void test4_f(a)

int test5_f(int (*)[10]);
int test5_f(int (*x)[]) {
return sizeof(*x); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
return sizeof(*x); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int[]'}}
}

void test6_f(int (*a)[11]);
Expand Down
22 changes: 11 additions & 11 deletions clang/test/Sema/nullability.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,37 +213,37 @@ void testDecayedType() {
int produceAnErrorMessage = arrays; // expected-warning {{incompatible pointer to integer conversion initializing 'int' with an expression of type 'void (int * _Nonnull, void ** _Nullable, void *** _Nullable, void * _Null_unspecified * _Nonnull * _Nullable, int * _Nonnull, int * _Nonnull, int * _Nonnull, int * _Nonnull, int * _Nonnull, void ** _Nullable)'}}
}

int notInFunction[_Nullable 3]; // expected-error {{nullability specifier '_Nullable' cannot be applied to non-pointer type 'int [3]'}}
int notInFunction[_Nullable 3]; // expected-error {{nullability specifier '_Nullable' cannot be applied to non-pointer type 'int[3]'}}

void nestedArrays(int x[5][_Nonnull 1]) {} // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [1]'}}
void nestedArrays2(int x[5][_Nonnull 1][2]) {} // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [1][2]'}}
void nestedArrays(int x[5][_Nonnull 1]) {} // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[1]'}}
void nestedArrays2(int x[5][_Nonnull 1][2]) {} // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[1][2]'}}
void nestedArraysOK(int x[_Nonnull 5][1]) {} // ok

void nullabilityOnBase(_Nonnull int x[1], // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int'}}
int _Nonnull y[1]); // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int'}}

typedef int INTS[4];
typedef int BAD_INTS[_Nonnull 4]; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [4]'}}
typedef int BAD_INTS[_Nonnull 4]; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[4]'}}

void typedefTest(INTS _Nonnull x,
_Nonnull INTS xx,
INTS _Nonnull y[2], // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
INTS _Nonnull y[2], // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}
INTS z[_Nonnull 2]);

INTS _Nonnull x; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
_Nonnull INTS x; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
INTS _Nonnull x; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}
_Nonnull INTS x; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}

void arraysInBlocks() {
typedef int INTS[4];
void (^simple)(int [_Nonnull 2]) = ^(int x[_Nonnull 2]) {};
simple(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
void (^nested)(void *_Nullable x[_Nonnull 2]) = ^(void *_Nullable x[_Nonnull 2]) {};
nested(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
void (^nestedBad)(int x[2][_Nonnull 2]) = // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [2]'}}
^(int x[2][_Nonnull 2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [2]'}}
void (^nestedBad)(int x[2][_Nonnull 2]) = // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[2]'}}
^(int x[2][_Nonnull 2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[2]'}}

void (^withTypedef)(INTS _Nonnull) = ^(INTS _Nonnull x) {};
withTypedef(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
void (^withTypedefBad)(INTS _Nonnull [2]) = // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
^(INTS _Nonnull x[2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
void (^withTypedefBad)(INTS _Nonnull [2]) = // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}
^(INTS _Nonnull x[2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}
}
2 changes: 1 addition & 1 deletion clang/test/Sema/predef.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void abcdefghi12(void) {
}

char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
expected-warning {{initializing 'char *' with an expression of type 'const char [1]' discards qualifiers}}
expected-warning {{initializing 'char *' with an expression of type 'const char[1]' discards qualifiers}}

void a() {
__func__[0] = 'a'; // expected-error {{variable is not assignable}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/typedef-retain.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef int a[5];
void test3() {
typedef const a b;
b r; // expected-note {{variable 'r' declared const here}}
r[0] = 10; // expected-error {{cannot assign to variable 'r' with const-qualified type 'b' (aka 'const int [5]')}}
r[0] = 10; // expected-error {{cannot assign to variable 'r' with const-qualified type 'b' (aka 'const int[5]')}}
}

int test4(const a y) {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/types.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int i[(short)1];

enum e { e_1 };
extern int j[sizeof(enum e)]; // expected-note {{previous declaration}}
int j[42]; // expected-error {{redefinition of 'j' with a different type: 'int [42]' vs 'int [4]'}}
int j[42]; // expected-error {{redefinition of 'j' with a different type: 'int[42]' vs 'int[4]'}}

// rdar://6880104
_Decimal32 x; // expected-error {{GNU decimal type extension not supported}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/var-redecl.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ void f(int x) { // expected-note {{previous definition is here}}

extern int b[];
void g20() { extern int b[3]; } // expected-note{{previous declaration is here}}
void g21() { extern int b[4]; } // expected-error{{redeclaration of 'b' with a different type: 'int [4]' vs 'int [3]'}}
void g21() { extern int b[4]; } // expected-error{{redeclaration of 'b' with a different type: 'int[4]' vs 'int[3]'}}
2 changes: 1 addition & 1 deletion clang/test/Sema/vla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

void f1(int n) {
typedef int x[n];
const x y; // expected-error {{default initialization of an object of const type 'const x' (aka 'const int [n]')}}
const x y; // expected-error {{default initialization of an object of const type 'const x' (aka 'const int[n]')}}
}
10 changes: 5 additions & 5 deletions clang/test/Sema/warn-sizeof-array-decay.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ void f(int x) {
int bar[20];
char qux[30];

(void)sizeof(bar + 10); // expected-warning{{sizeof on pointer operation will return size of 'int *' instead of 'int [20]'}}
(void)sizeof(foo - 20); // expected-warning{{sizeof on pointer operation will return size of 'char *' instead of 'char [10]'}}
(void)sizeof(bar - x); // expected-warning{{sizeof on pointer operation will return size of 'int *' instead of 'int [20]'}}
(void)sizeof(foo + x); // expected-warning{{sizeof on pointer operation will return size of 'char *' instead of 'char [10]'}}
(void)sizeof(bar + 10); // expected-warning{{sizeof on pointer operation will return size of 'int *' instead of 'int[20]'}}
(void)sizeof(foo - 20); // expected-warning{{sizeof on pointer operation will return size of 'char *' instead of 'char[10]'}}
(void)sizeof(bar - x); // expected-warning{{sizeof on pointer operation will return size of 'int *' instead of 'int[20]'}}
(void)sizeof(foo + x); // expected-warning{{sizeof on pointer operation will return size of 'char *' instead of 'char[10]'}}

// This is ptrdiff_t.
(void)sizeof(foo - qux); // no-warning

(void)sizeof(foo, x); // no-warning
(void)sizeof(x, foo); // expected-warning{{sizeof on pointer operation will return size of 'char *' instead of 'char [10]'}}
(void)sizeof(x, foo); // expected-warning{{sizeof on pointer operation will return size of 'char *' instead of 'char[10]'}}
}
8 changes: 4 additions & 4 deletions clang/test/Sema/warn-sizeof-arrayarg.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ void f(int a[10], Arr arr) { // expected-note 4 {{declared here}}

/* Should warn. */
(void)sizeof(a); // \
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int [10]'}}
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int[10]'}}
(void)sizeof((((a)))); // \
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int [10]'}}
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int[10]'}}
(void)sizeof a; // \
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int [10]'}}
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'int[10]'}}
(void)sizeof arr; // \
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'Arr' (aka 'int [10]')}}
// expected-warning{{sizeof on array function parameter will return size of 'int *' instead of 'Arr' (aka 'int[10]')}}

/* Shouldn't warn. */
int b[10];
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Sema/warn-write-strings.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -verify -fsyntax-only -fconst-strings %s

// PR4804
char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char [4]' discards qualifiers}}
char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char[4]' discards qualifiers}}

// PR7192
#include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/MicrosoftExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void test_unaligned() {
p3_aligned_type4 = p1_aligned_type4;

__unaligned int a[10];
int *b = a; // expected-error {{cannot initialize a variable of type 'int *' with an lvalue of type '__unaligned int [10]'}}
int *b = a; // expected-error {{cannot initialize a variable of type 'int *' with an lvalue of type '__unaligned int[10]'}}
}

// Test from PR27367
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/address-space-initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int nocv_iarray[10] = { 4 };


__attribute__((address_space(9999)))
int* as_ptr = nocv_iarray; // expected-error{{cannot initialize a variable of type '__attribute__((address_space(9999))) int *' with an lvalue of type '__attribute__((address_space(42))) int [10]'}}
int* as_ptr = nocv_iarray; // expected-error{{cannot initialize a variable of type '__attribute__((address_space(9999))) int *' with an lvalue of type '__attribute__((address_space(42))) int[10]'}}


__attribute__((address_space(42))) int* __attribute__((address_space(42))) ptr_in_same_addr_space = nocv_iarray;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/alias-template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace VariableLengthArrays {
const int m = 42;
template<typename Z> using U = int[m];
template<typename Z> using U = int[42]; // expected-note {{previous definition}}
template<typename Z> using U = int; // expected-error {{type alias template redefinition with different types ('int' vs 'int [42]')}}
template<typename Z> using U = int; // expected-error {{type alias template redefinition with different types ('int' vs 'int[42]')}}
}

namespace RedeclFunc {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/array-bound-merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int b[];
extern int c[1];
int c[] = {1,2}; // expected-error {{excess elements in array initializer}}

int d[1][]; // expected-error {{array has incomplete element type 'int []'}}
int d[1][]; // expected-error {{array has incomplete element type 'int[]'}}

extern const int e[2]; // expected-note {{previous declaration is here}}
int e[] = { 1 }; // expected-error {{redefinition of 'e' with a different type: 'int []' vs 'const int [2]'}}
int e[] = { 1 }; // expected-error {{redefinition of 'e' with a different type: 'int[]' vs 'const int[2]'}}
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/attr-gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ void f() {
void g(int a[static [[]] 5]); // expected-error {{static array size is a C99 feature, not permitted in C++}}

template<typename T> struct A {
int x[sizeof(T)] __attribute((vector_size(8))); // expected-error {{invalid vector element type 'int [sizeof(T)]'}}
int x[sizeof(T)] __attribute((vector_size(8))); // expected-error {{invalid vector element type 'int[sizeof(T)]'}}
};

typedef int myvect[4] __attribute__((vector_size(16))); // expected-error {{invalid vector element type 'int [4]'}}
typedef int myvect[4] __attribute__((vector_size(16))); // expected-error {{invalid vector element type 'int[4]'}}
void foo(myvect *in, myvect *out) { (*out)[0] = (*in)[0]; }

namespace {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/c99-variable-length-array-cxx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void vla(int N) { // expected-note 5{{here}}
POD array2[N]; // expected-warning{{variable length arrays are a C99 feature}} expected-note {{parameter 'N'}}
StillPOD array3[N]; // expected-warning{{variable length arrays are a C99 feature}} expected-note {{parameter 'N'}}
StillPOD2 array4[N][3]; // expected-warning{{variable length arrays are a C99 feature}} expected-note {{parameter 'N'}}
NonPOD array5[N]; // expected-error{{no matching constructor for initialization of 'NonPOD [N]'}}
NonPOD array5[N]; // expected-error{{no matching constructor for initialization of 'NonPOD[N]'}}
// expected-warning@-1{{variable length arrays are a C99 feature}} expected-note@-1 {{parameter 'N'}}
// expected-note@-16{{candidate constructor not viable}}
// expected-note@-18{{candidate constructor (the implicit copy constructor) not viable}}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/c99-variable-length-array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template<typename T> struct X0 { };
// argument.
void inst_with_vla(int N) {
int array[N]; // expected-warning{{variable length arrays are a C99 feature}}
X0<__typeof__(array)> x0a; // expected-error{{variably modified type 'typeof (array)' (aka 'int [N]') cannot be used as a template argument}}
X0<__typeof__(array)> x0a; // expected-error{{variably modified type 'typeof (array)' (aka 'int[N]') cannot be used as a template argument}}
}

template<typename T>
Expand All @@ -70,7 +70,7 @@ X1<HasNonConstantValue> x1b; // expected-note{{in instantiation of}}
// Template argument deduction does not allow deducing a size from a VLA.
// FIXME: This diagnostic should make it clear that the two 'N's are different entities!
template<typename T, unsigned N>
void accept_array(T (&array)[N]); // expected-note{{candidate template ignored: could not match 'T [N]' against 'int [N]'}}
void accept_array(T (&array)[N]); // expected-note{{candidate template ignored: could not match 'T[N]' against 'int[N]'}}

void test_accept_array(int N) {
int array[N]; // expected-warning{{variable length arrays are a C99 feature}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/compare-cxx2a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void test_array_conv() {
int arr[5];
int *ap = arr + 2;
int arr2[3];
(void)(arr <=> arr); // expected-error {{invalid operands to binary expression ('int [5]' and 'int [5]')}}
(void)(arr <=> arr); // expected-error {{invalid operands to binary expression ('int[5]' and 'int[5]')}}
(void)(+arr <=> arr);
}

Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/constant-expression-cxx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,11 +2065,11 @@ namespace ZeroSizeTypes {
constexpr int (*p1)[0] = 0, (*p2)[0] = 0;
constexpr int k = p2 - p1;
// expected-error@-1 {{constexpr variable 'k' must be initialized by a constant expression}}
// expected-note@-2 {{subtraction of pointers to type 'int [0]' of zero size}}
// expected-note@-2 {{subtraction of pointers to type 'int[0]' of zero size}}

int arr[5][0];
constexpr int f() { // expected-error {{never produces a constant expression}}
return &arr[3] - &arr[0]; // expected-note {{subtraction of pointers to type 'int [0]' of zero size}}
return &arr[3] - &arr[0]; // expected-note {{subtraction of pointers to type 'int[0]' of zero size}}
}
}

Expand Down
8 changes: 4 additions & 4 deletions clang/test/SemaCXX/constant-expression-cxx2a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,15 +816,15 @@ namespace dynamic_alloc {
S *p = new T[3]{&a, &a, &a}; // expected-note 2{{heap allocation}}
switch (mode) {
case 0:
delete p; // expected-note {{non-array delete used to delete pointer to array object of type 'T [3]'}}
delete p; // expected-note {{non-array delete used to delete pointer to array object of type 'T[3]'}}
break;
case 1:
// FIXME: This diagnosic isn't great; we should mention the cast to S*
// somewhere in here.
delete[] p; // expected-note {{delete of pointer to subobject '&{*new T [3]#0}[0]'}}
delete[] p; // expected-note {{delete of pointer to subobject '&{*new T[3]#0}[0]'}}
break;
case 2:
delete (T*)p; // expected-note {{non-array delete used to delete pointer to array object of type 'T [3]'}}
delete (T*)p; // expected-note {{non-array delete used to delete pointer to array object of type 'T[3]'}}
break;
case 3:
delete[] (T*)p;
Expand Down Expand Up @@ -1033,7 +1033,7 @@ namespace delete_random_things {
struct A { int n; };
static_assert((delete &(new A)->n, true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new delete_random_things::A#0}.n'}}
static_assert((delete (new int + 1), true)); // expected-error {{}} expected-note {{delete of pointer '&{*new int#0} + 1' that does not point to complete object}}
static_assert((delete[] (new int[3] + 1), true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new int [3]#0}[1]'}}
static_assert((delete[] (new int[3] + 1), true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new int[3]#0}[1]'}}
static_assert((delete &(int&)(int&&)0, true)); // expected-error {{}} expected-note {{delete of pointer '&0' that does not point to a heap-allocated object}} expected-note {{temporary created here}}
}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void backtrace() {
};

struct B {
// expected-note@+1 {{invalid type 'A [10]' is a member of 'B'}}
// expected-note@+1 {{invalid type 'A[10]' is a member of 'B'}}
A as[10];
};

Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/constexpr-string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ namespace MemcpyEtc {
constexpr int test_address_of_incomplete_array_type() { // expected-error {{never produces a constant}}
extern int arr[];
__builtin_memmove(&arr, &arr, 4 * sizeof(arr[0]));
// expected-note@-1 2{{cannot constant evaluate 'memmove' between objects of incomplete type 'int []'}}
// expected-note@-1 2{{cannot constant evaluate 'memmove' between objects of incomplete type 'int[]'}}
return arr[0] * 1000 + arr[1] * 100 + arr[2] * 10 + arr[3];
}
static_assert(test_address_of_incomplete_array_type() == 1234); // expected-error {{constant}} expected-note {{in call}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/coroutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void coreturn(int n) {
if (n == 1)
co_return {4}; // expected-warning {{braces around scalar initializer}}
if (n == 2)
co_return "foo"; // expected-error {{cannot initialize a parameter of type 'int' with an lvalue of type 'const char [4]'}}
co_return "foo"; // expected-error {{cannot initialize a parameter of type 'int' with an lvalue of type 'const char[4]'}}
co_return 42;
}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/cxx0x-initializer-aggregates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace multidimensional_array {

namespace array_addressof {
using T = int[5];
T *p = &T{1,2,3,4,5}; // expected-error {{taking the address of a temporary object of type 'array_addressof::T' (aka 'int [5]')}}
T *p = &T{1,2,3,4,5}; // expected-error {{taking the address of a temporary object of type 'array_addressof::T' (aka 'int[5]')}}
}

namespace PR24816 {
Expand Down
12 changes: 6 additions & 6 deletions clang/test/SemaCXX/cxx0x-type-convert-construct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

void f() {
char *u8str;
u8str = u8"a UTF-8 string"; // expected-error {{assigning to 'char *' from incompatible type 'const char [15]'}}
u8str = u8"a UTF-8 string"; // expected-error {{assigning to 'char *' from incompatible type 'const char[15]'}}
char16_t *ustr;
ustr = u"a UTF-16 string"; // expected-error {{assigning to 'char16_t *' from incompatible type 'const char16_t [16]'}}
ustr = u"a UTF-16 string"; // expected-error {{assigning to 'char16_t *' from incompatible type 'const char16_t[16]'}}
char32_t *Ustr;
Ustr = U"a UTF-32 string"; // expected-error {{assigning to 'char32_t *' from incompatible type 'const char32_t [16]'}}
Ustr = U"a UTF-32 string"; // expected-error {{assigning to 'char32_t *' from incompatible type 'const char32_t[16]'}}

char *Rstr;
Rstr = R"foo(a raw string)foo"; // expected-warning{{ISO C++11 does not allow conversion from string literal to 'char *'}}
wchar_t *LRstr;
LRstr = LR"foo(a wide raw string)foo"; // expected-warning{{ISO C++11 does not allow conversion from string literal to 'wchar_t *'}}
char *u8Rstr;
u8Rstr = u8R"foo(a UTF-8 raw string)foo"; // expected-error {{assigning to 'char *' from incompatible type 'const char [19]'}}
u8Rstr = u8R"foo(a UTF-8 raw string)foo"; // expected-error {{assigning to 'char *' from incompatible type 'const char[19]'}}
char16_t *uRstr;
uRstr = uR"foo(a UTF-16 raw string)foo"; // expected-error {{assigning to 'char16_t *' from incompatible type 'const char16_t [20]'}}
uRstr = uR"foo(a UTF-16 raw string)foo"; // expected-error {{assigning to 'char16_t *' from incompatible type 'const char16_t[20]'}}
char32_t *URstr;
URstr = UR"foo(a UTF-32 raw string)foo"; // expected-error {{assigning to 'char32_t *' from incompatible type 'const char32_t [20]'}}
URstr = UR"foo(a UTF-32 raw string)foo"; // expected-error {{assigning to 'char32_t *' from incompatible type 'const char32_t[20]'}}
}
10 changes: 5 additions & 5 deletions clang/test/SemaCXX/cxx1z-decomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ void num_elems() {

auto [] = a0; // expected-warning {{does not allow a decomposition group to be empty}}
auto [v1] = a0; // expected-error {{type 'A0' decomposes into 0 elements, but 1 name was provided}}
auto [] = a1; // expected-error {{type 'int [1]' decomposes into 1 element, but no names were provided}} expected-warning {{empty}}
auto [] = a1; // expected-error {{type 'int[1]' decomposes into 1 element, but no names were provided}} expected-warning {{empty}}
auto [v2] = a1;
auto [v3, v4] = a1; // expected-error {{type 'int [1]' decomposes into 1 element, but 2 names were provided}}
auto [] = a2; // expected-error {{type 'int [2]' decomposes into 2 elements, but no names were provided}} expected-warning {{empty}}
auto [v5] = a2; // expected-error {{type 'int [2]' decomposes into 2 elements, but only 1 name was provided}}
auto [v3, v4] = a1; // expected-error {{type 'int[1]' decomposes into 1 element, but 2 names were provided}}
auto [] = a2; // expected-error {{type 'int[2]' decomposes into 2 elements, but no names were provided}} expected-warning {{empty}}
auto [v5] = a2; // expected-error {{type 'int[2]' decomposes into 2 elements, but only 1 name was provided}}
auto [v6, v7] = a2;
auto [v8, v9, v10] = a2; // expected-error {{type 'int [2]' decomposes into 2 elements, but 3 names were provided}}
auto [v8, v9, v10] = a2; // expected-error {{type 'int[2]' decomposes into 2 elements, but 3 names were provided}}
}

// As a Clang extension, _Complex can be decomposed.
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/cxx2a-compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ string u8str = u8"test" u8"test";
// expected-warning@-4 {{type of UTF-8 string literal will change}} expected-note@-4 {{remove 'u8' prefix}}
#else
// expected-error@-8 {{ISO C++20 does not permit initialization of char array with UTF-8 string literal}}
// expected-error@-8 {{cannot initialize a variable of type 'const char *' with an lvalue of type 'const char8_t [6]'}}
// expected-error@-8 {{no viable conversion from 'const char8_t [9]' to 'string'}}
// expected-error@-8 {{cannot initialize a variable of type 'const char *' with an lvalue of type 'const char8_t[6]'}}
// expected-error@-8 {{no viable conversion from 'const char8_t[9]' to 'string'}}
#endif

template<bool b>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/dcl_init_aggr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ u u1 = { 1 };
u u2 = u1;
u u3 = 1; // expected-error{{no viable conversion}}
u u4 = { 0, "asdf" }; // expected-error{{excess elements in union initializer}}
u u5 = { "asdf" }; // expected-error{{cannot initialize a member subobject of type 'int' with an lvalue of type 'const char [5]'}}
u u5 = { "asdf" }; // expected-error{{cannot initialize a member subobject of type 'int' with an lvalue of type 'const char[5]'}}
6 changes: 3 additions & 3 deletions clang/test/SemaCXX/decl-init-ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ int main() {
}

struct PR6139 { A (&x)[1]; };
PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to an initializer list temporary}}
PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A[1]' cannot bind to an initializer list temporary}}

struct PR6139b { A (&x)[1]; };
PR6139b y = {A()}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to a temporary of type 'A'}}
PR6139b y = {A()}; // expected-error{{non-const lvalue reference to type 'A[1]' cannot bind to a temporary of type 'A'}}

namespace PR16502 {
struct A { int &&temporary; int x, y; };
Expand All @@ -39,7 +39,7 @@ namespace PR16502 {

namespace IncompleteTest {
struct String;
// expected-error@+1 {{reference to incomplete type 'const IncompleteTest::String' could not bind to an lvalue of type 'const char [1]'}}
// expected-error@+1 {{reference to incomplete type 'const IncompleteTest::String' could not bind to an lvalue of type 'const char[1]'}}
void takeString(const String& = "") {} // expected-note {{passing argument to parameter here}}
void test() {
takeString();
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ namespace Decay {

C<E[10]> e;
#if __cplusplus <= 199711L
// expected-note@-2 {{in instantiation of template class 'Decay::C<Decay::E [10]>' requested here}}
// expected-note@-2 {{in instantiation of template class 'Decay::C<Decay::E[10]>' requested here}}
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/flexible-array-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ union B {
};

class C {
char c[]; // expected-error {{flexible array member 'c' with type 'char []' is not at the end of class}}
char c[]; // expected-error {{flexible array member 'c' with type 'char[]' is not at the end of class}}
int s; // expected-note {{next field declaration is here}}
};

Expand All @@ -93,7 +93,7 @@ struct NonTrivDtor { ~NonTrivDtor(); };
// FIXME: It's not clear whether we should disallow examples like this. GCC accepts.
struct FlexNonTrivDtor {
int n;
NonTrivDtor ntd[]; // expected-error {{flexible array member 'ntd' of type 'NonTrivDtor []' with non-trivial destruction}}
NonTrivDtor ntd[]; // expected-error {{flexible array member 'ntd' of type 'NonTrivDtor[]' with non-trivial destruction}}
~FlexNonTrivDtor() {
for (int i = n; i != 0; --i)
ntd[i-1].~NonTrivDtor();
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/for-range-examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ namespace test5 {
namespace test6 {
void foo(int arr[]) { // expected-note {{declared here}}
for (auto i : arr) { }
// expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'int []' is treated as pointer type 'int *'}}
// expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'int[]' is treated as pointer type 'int *'}}
}

struct vector {
Expand All @@ -207,7 +207,7 @@ namespace test6 {
void foo(vector arr[]) { // expected-note {{declared here}}
// Don't suggest to dereference arr.
for (auto i : arr) { }
// expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'test6::vector []' is treated as pointer type 'test6::vector *'}}
// expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'test6::vector[]' is treated as pointer type 'test6::vector *'}}
}
}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/new-delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void h(unsigned i) {
(void)new T(i); // expected-error {{array 'new' cannot have initialization arguments}}
}
template void h<unsigned>(unsigned);
template void h<unsigned[10]>(unsigned); // expected-note {{in instantiation of function template specialization 'Test1::h<unsigned int [10]>' requested here}}
template void h<unsigned[10]>(unsigned); // expected-note {{in instantiation of function template specialization 'Test1::h<unsigned int[10]>' requested here}}

}

Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/no-wchar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ void foo1(wchar_t * t = L"");
#endif

short *a = L"";
// expected-error@-1 {{cannot initialize a variable of type 'short *' with an lvalue of type 'const unsigned short [1]'}}
// expected-error@-1 {{cannot initialize a variable of type 'short *' with an lvalue of type 'const unsigned short[1]'}}
char *b = L"";
// expected-error@-1 {{cannot initialize a variable of type 'char *' with an lvalue of type 'const unsigned short [1]'}}
// expected-error@-1 {{cannot initialize a variable of type 'char *' with an lvalue of type 'const unsigned short[1]'}}

// NOTE: MSVC allows deprecated conversion in conditional expression if at least
// one of the operand is a string literal but Clang doesn't allow it.
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/nullability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ void arraysInLambdas() {
simple(nullptr); // expected-warning {{null passed to a callee that requires a non-null argument}}
auto nested = [](void *_Nullable [_Nonnull 2]) {};
nested(nullptr); // expected-warning {{null passed to a callee that requires a non-null argument}}
auto nestedBad = [](int [2][_Nonnull 2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [2]'}}
auto nestedBad = [](int [2][_Nonnull 2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[2]'}}

auto withTypedef = [](INTS _Nonnull) {};
withTypedef(nullptr); // expected-warning {{null passed to a callee that requires a non-null argument}}
auto withTypedefBad = [](INTS _Nonnull[2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
auto withTypedefBad = [](INTS _Nonnull[2]) {}; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}
}

void testNullabilityCompletenessWithTemplate() {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/overload-call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ namespace PR5756 {
// Tests the exact text used to note the candidates
namespace test1 {
template <class T>
void foo(T t, unsigned N); // expected-note {{candidate function template not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}}
void foo(T t, unsigned N); // expected-note {{candidate function template not viable: no known conversion from 'const char[6]' to 'unsigned int' for 2nd argument}}
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char[6]' to 'char' for 2nd argument}}
void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/overload-member-call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ void test_X2(X2 *x2p, const X2 *cx2p) {
namespace test1 {
class A {
template <class T>
void foo(T t, unsigned N); // expected-note {{candidate function template not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}}
void foo(T t, unsigned N); // expected-note {{candidate function template not viable: no known conversion from 'const char[6]' to 'unsigned int' for 2nd argument}}
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char[6]' to 'char' for 2nd argument}}
void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/static-assert-cxx17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ template void foo3<S2<long>, int, float>();
template <typename T>
void foo4() {
static_assert(S1<T[sizeof(T)], int[4]>::value, "");
// expected-error@-1{{static_assert failed due to requirement 'S1<float [4], int [4]>::value'}}
// expected-error@-1{{static_assert failed due to requirement 'S1<float[4], int[4]>::value'}}
};
template void foo4<float>();
// expected-note@-1{{in instantiation of function template specialization 'foo4<float>' requested here}}
Expand Down Expand Up @@ -94,7 +94,7 @@ void foo6() {
static_assert(static_cast<const X<typename T::T> *>(nullptr));
// expected-error@-1{{static_assert failed due to requirement 'static_cast<const X<int> *>(nullptr)'}}
static_assert((const X<typename T::T>[]){} == nullptr);
// expected-error@-1{{static_assert failed due to requirement '(const X<int> [0]){} == nullptr'}}
// expected-error@-1{{static_assert failed due to requirement '(const X<int>[0]){} == nullptr'}}
static_assert(sizeof(X<decltype(X<typename T::T>().X<typename T::T>::~X())>) == 0);
// expected-error@-1{{static_assert failed due to requirement 'sizeof(X<void>) == 0'}}
static_assert(constexpr_return_false<typename T::T, typename T::U>());
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/typedef-redecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace PR11630 {
static void f()
{
typedef int q[C == 1 ? 1 : -1]; // expected-note{{previous definition is here}}
typedef int q[C >= 1 ? 2 : -2]; // expected-error{{typedef redefinition with different types ('int [2]' vs 'int [1]')}}
typedef int q[C >= 1 ? 2 : -2]; // expected-error{{typedef redefinition with different types ('int[2]' vs 'int[1]')}}
typedef int n[C == 1 ? 1 : -1];
typedef int n[C >= 1 ? 1 : -1];
}
Expand All @@ -80,7 +80,7 @@ namespace PR11630 {
static void f()
{
typedef int q[1]; // expected-note{{previous definition is here}}
typedef int q[T]; // expected-error{{typedef redefinition with different types ('int [2]' vs 'int [1]')}}
typedef int q[T]; // expected-error{{typedef redefinition with different types ('int[2]' vs 'int[1]')}}
}
};

Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/typeid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void g1(X &x) {

void h(int i) {
char V[i];
typeid(V); // expected-error{{'typeid' of variably modified type 'char [i]'}}
typeid(char [i]); // expected-error{{'typeid' of variably modified type 'char [i]'}}
typeid(V); // expected-error{{'typeid' of variably modified type 'char[i]'}}
typeid(char [i]); // expected-error{{'typeid' of variably modified type 'char[i]'}}
}

// expected-note@+1 {{read of object 'typeid(int).name' whose value is not known}}
Expand Down
22 changes: 11 additions & 11 deletions clang/test/SemaCXX/warn-string-conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
// An exception is made for this in logical and operators.
void assert(bool condition);
void test0() {
bool b0 = "hi"; // expected-warning{{implicit conversion turns string literal into bool: 'const char [3]' to 'bool'}}
b0 = ""; // expected-warning{{implicit conversion turns string literal into bool: 'const char [1]' to 'bool'}}
b0 = 0 || ""; // expected-warning{{implicit conversion turns string literal into bool: 'const char [1]' to 'bool'}}
b0 = "" || 0; // expected-warning{{implicit conversion turns string literal into bool: 'const char [1]' to 'bool'}}
bool b0 = "hi"; // expected-warning{{implicit conversion turns string literal into bool: 'const char[3]' to 'bool'}}
b0 = ""; // expected-warning{{implicit conversion turns string literal into bool: 'const char[1]' to 'bool'}}
b0 = 0 || ""; // expected-warning{{implicit conversion turns string literal into bool: 'const char[1]' to 'bool'}}
b0 = "" || 0; // expected-warning{{implicit conversion turns string literal into bool: 'const char[1]' to 'bool'}}
b0 = 0 && "";
b0 = "" && 0;
assert("error"); // expected-warning{{implicit conversion turns string literal into bool: 'const char [6]' to 'bool'}}
assert(0 || "error"); // expected-warning{{implicit conversion turns string literal into bool: 'const char [6]' to 'bool'}}
assert("error" || 0); // expected-warning{{implicit conversion turns string literal into bool: 'const char [6]' to 'bool'}}
assert("error"); // expected-warning{{implicit conversion turns string literal into bool: 'const char[6]' to 'bool'}}
assert(0 || "error"); // expected-warning{{implicit conversion turns string literal into bool: 'const char[6]' to 'bool'}}
assert("error" || 0); // expected-warning{{implicit conversion turns string literal into bool: 'const char[6]' to 'bool'}}
assert(0 && "error");
assert("error" && 0);

while("hi") {} // expected-warning{{implicit conversion turns string literal into bool: 'const char [3]' to 'bool'}}
do {} while("hi"); // expected-warning{{implicit conversion turns string literal into bool: 'const char [3]' to 'bool'}}
for (;"hi";); // expected-warning{{implicit conversion turns string literal into bool: 'const char [3]' to 'bool'}}
if("hi") {} // expected-warning{{implicit conversion turns string literal into bool: 'const char [3]' to 'bool'}}
while("hi") {} // expected-warning{{implicit conversion turns string literal into bool: 'const char[3]' to 'bool'}}
do {} while("hi"); // expected-warning{{implicit conversion turns string literal into bool: 'const char[3]' to 'bool'}}
for (;"hi";); // expected-warning{{implicit conversion turns string literal into bool: 'const char[3]' to 'bool'}}
if("hi") {} // expected-warning{{implicit conversion turns string literal into bool: 'const char[3]' to 'bool'}}
}

2 changes: 1 addition & 1 deletion clang/test/SemaObjC/argument-checking.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void test() {
struct S sInst;

charStarFunc(1); // expected-warning {{incompatible integer to pointer conversion passing 'int' to parameter of type 'char *'}}
charFunc("abc"); // expected-warning {{incompatible pointer to integer conversion passing 'char [4]' to parameter of type 'char'}}
charFunc("abc"); // expected-warning {{incompatible pointer to integer conversion passing 'char[4]' to parameter of type 'char'}}

[obj charStarMeth:1]; // expected-warning {{incompatible integer to pointer conversion sending 'int'}}
[obj structMeth:1]; // expected-error {{sending 'int'}}
Expand Down
48 changes: 24 additions & 24 deletions clang/test/SemaObjC/flexible-array.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ @interface LastIvar {
@end

@interface NotLastIvar {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
int last; // expected-note {{next instance variable declaration is here}}
}
@end
Expand All @@ -17,28 +17,28 @@ @interface NotLastIvar {
@interface LastIvarInImpl
@end
@implementation LastIvarInImpl {
char flexible[]; // expected-warning {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-warning {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
}
@end

@interface NotLastIvarInImpl
@end
@implementation NotLastIvarInImpl {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
int last; // expected-note {{next instance variable declaration is here}}
}
@end

@implementation NotLastIvarInImplWithoutInterface { // expected-warning {{cannot find interface declaration for 'NotLastIvarInImplWithoutInterface'}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
int last; // expected-note {{next instance variable declaration is here}}
}
@end

@interface LastIvarInClass_OtherIvarInImpl {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
}
@end
@implementation LastIvarInClass_OtherIvarInImpl {
Expand All @@ -59,21 +59,21 @@ @implementation LastIvarInClass_UnrelatedVarInImpl
@interface LastIvarInExtension
@end
@interface LastIvarInExtension() {
char flexible[]; // expected-warning {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-warning {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
}
@end

@interface NotLastIvarInExtension
@end
@interface NotLastIvarInExtension() {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
int last; // expected-note {{next instance variable declaration is here}}
}
@end

@interface LastIvarInClass_OtherIvarInExtension {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
}
@end
@interface LastIvarInClass_OtherIvarInExtension() {
Expand All @@ -91,16 +91,16 @@ @interface LastIvarInExtension_OtherIvarInExtension()
// Extension without ivars to test we see through such extensions.
@end
@interface LastIvarInExtension_OtherIvarInExtension() {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
}
@end

@interface LastIvarInExtension_OtherIvarInImpl
@end
@interface LastIvarInExtension_OtherIvarInImpl() {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char []' is not visible to subclasses and can conflict with their instance variables}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
// expected-warning@-1 {{field 'flexible' with variable sized type 'char[]' is not visible to subclasses and can conflict with their instance variables}}
}
@end
@implementation LastIvarInExtension_OtherIvarInImpl {
Expand All @@ -120,7 +120,7 @@ @interface IvarInNamedCategory(Category) {
@interface LastIvarAndProperty {
char _flexible[];
}
@property char flexible[]; // expected-error {{property cannot have array or function type 'char []'}}
@property char flexible[]; // expected-error {{property cannot have array or function type 'char[]'}}
@end

// ## Synthesize other instance variables.
Expand All @@ -145,7 +145,7 @@ @implementation LastIvar_ImplicitlyNamedPropertyBackingIvarPreceding
@end

@interface NotLastIvar_ExplicitlyNamedPropertyBackingIvarLast {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
}
@property int count;
@end
Expand All @@ -154,7 +154,7 @@ @implementation NotLastIvar_ExplicitlyNamedPropertyBackingIvarLast
@end

@interface NotLastIvar_ImplicitlyNamedPropertyBackingIvarLast {
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char []' is not at the end of class}}
char flexible[]; // expected-error {{flexible array member 'flexible' with type 'char[]' is not at the end of class}}
}
@property int count; // expected-note {{next synthesized instance variable is here}}
@end
Expand Down Expand Up @@ -244,33 +244,33 @@ @implementation NoIvarAdditions
@end

@interface AddedIvarInInterface : FlexibleArrayMemberBase {
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char []' in superclass 'FlexibleArrayMemberBase'}}
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char[]' in superclass 'FlexibleArrayMemberBase'}}
}
@end

@interface AddedIvarInImplementation : FlexibleArrayMemberBase
@end
@implementation AddedIvarInImplementation {
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char []' in superclass 'FlexibleArrayMemberBase'}}
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char[]' in superclass 'FlexibleArrayMemberBase'}}
}
@end

@interface AddedIvarInExtension : FlexibleArrayMemberBase
@end
@interface AddedIvarInExtension() {
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char []' in superclass 'FlexibleArrayMemberBase'}}
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char[]' in superclass 'FlexibleArrayMemberBase'}}
}
@end

@interface SynthesizedIvar : FlexibleArrayMemberBase
@property int count;
@end
@implementation SynthesizedIvar
@synthesize count; // expected-warning {{field 'count' can overwrite instance variable 'flexible' with variable sized type 'char []' in superclass 'FlexibleArrayMemberBase'}}
@synthesize count; // expected-warning {{field 'count' can overwrite instance variable 'flexible' with variable sized type 'char[]' in superclass 'FlexibleArrayMemberBase'}}
@end

@interface WarnInSubclassOnlyOnce : FlexibleArrayMemberBase {
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char []' in superclass 'FlexibleArrayMemberBase'}}
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char[]' in superclass 'FlexibleArrayMemberBase'}}
}
@end
@interface WarnInSubclassOnlyOnce() {
Expand All @@ -283,6 +283,6 @@ @implementation WarnInSubclassOnlyOnce {
@end

@interface AddedIvarInSubSubClass : NoIvarAdditions {
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char []' in superclass 'FlexibleArrayMemberBase'}}
int last; // expected-warning {{field 'last' can overwrite instance variable 'flexible' with variable sized type 'char[]' in superclass 'FlexibleArrayMemberBase'}}
}
@end
2 changes: 1 addition & 1 deletion clang/test/SemaObjC/ivar-sem-check-1.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@interface INTF
{
struct F {} JJ;
int arr[]; // expected-error {{flexible array member 'arr' with type 'int []' is not at the end of class}}
int arr[]; // expected-error {{flexible array member 'arr' with type 'int[]' is not at the end of class}}
struct S IC; // expected-error {{field has incomplete type}}
// expected-note@-1 {{next instance variable declaration is here}}
struct T { // expected-note {{previous definition is here}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaObjC/method-bad-param.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)crashMe:(enum bogus)p { // expected-error {{variable has incomplete type
@end

@interface arrayfun
- (int[6])arrayRet; // expected-error {{function cannot return array type 'int [6]'}}
- (int[6])arrayRet; // expected-error {{function cannot return array type 'int[6]'}}
- (int())funcRet; // expected-error {{function cannot return function type 'int ()'}}
@end

Expand Down
6 changes: 3 additions & 3 deletions clang/test/SemaObjC/nullability.m
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ void conditional_expr(int c) {
@interface ArraysInMethods
- (void)simple:(int [_Nonnull 2])x;
- (void)nested:(void *_Nullable [_Nonnull 2])x;
- (void)nestedBad:(int [2][_Nonnull 2])x; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int [2]'}}
- (void)nestedBad:(int [2][_Nonnull 2])x; // expected-error {{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int[2]'}}

- (void)withTypedef:(INTS _Nonnull)x;
- (void)withTypedefBad:(INTS _Nonnull[2])x; // expected-error{{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int [4]')}}
- (void)withTypedefBad:(INTS _Nonnull[2])x; // expected-error{{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'INTS' (aka 'int[4]')}}

- (void)simpleSugar:(nonnull int [2])x;
- (void)nestedSugar:(nonnull void *_Nullable [2])x; // expected-error {{nullability keyword 'nonnull' cannot be applied to multi-level pointer type 'void * _Nullable [2]'}} expected-note {{use nullability type specifier '_Nonnull' to affect the innermost pointer type of 'void * _Nullable [2]'}}
- (void)nestedSugar:(nonnull void *_Nullable [2])x; // expected-error {{nullability keyword 'nonnull' cannot be applied to multi-level pointer type 'void * _Nullable[2]'}} expected-note {{use nullability type specifier '_Nonnull' to affect the innermost pointer type of 'void * _Nullable[2]'}}
- (void)sugarWithTypedef:(nonnull INTS)x;
@end

Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaObjC/rdr-6211479-array-property.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
typedef int T[2];

@interface A
@property(assign) T p2; // expected-error {{property cannot have array or function type 'T' (aka 'int [2]')}}
@property(assign) T p2; // expected-error {{property cannot have array or function type 'T' (aka 'int[2]')}}
@end
2 changes: 1 addition & 1 deletion clang/test/SemaObjC/warn-write-strings.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -verify -fsyntax-only -fconst-strings %s

// PR4804
char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char [4]' discards qualifiers}}
char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char[4]' discards qualifiers}}
2 changes: 1 addition & 1 deletion clang/test/SemaObjCXX/message.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ @interface I5

void test_I5(I5 *i5, String s) {
[i5 method:"hello" other:s];
[i5 method:s other:"world"]; // expected-error{{non-const lvalue reference to type 'String' cannot bind to a value of unrelated type 'const char [6]'}}
[i5 method:s other:"world"]; // expected-error{{non-const lvalue reference to type 'String' cannot bind to a value of unrelated type 'const char[6]'}}
}

// <rdar://problem/8483253>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaOpenCL/half.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ constant float f = 1.0h; // expected-error{{half precision constant requires cl_
half half_disabled(half *p, // expected-error{{declaring function return value of type 'half' is not allowed}}
half h) // expected-error{{declaring function parameter of type '__private half' is not allowed}}
{
half a[2]; // expected-error{{declaring variable of type '__private half [2]' is not allowed}}
half a[2]; // expected-error{{declaring variable of type '__private half[2]' is not allowed}}
half b; // expected-error{{declaring variable of type '__private half' is not allowed}}
*p; // expected-error{{loading directly from pointer to type '__private half' requires cl_khr_fp16. Use vector data load builtin functions instead}}
*p = 0; // expected-error{{assigning directly to pointer to type 'half' requires cl_khr_fp16. Use vector data store builtin functions instead}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaOpenCL/invalid-kernel-parameters.cl
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ kernel void array_of_ptr(struct ArrayOfPtr arr) {} // expected-error{{struct ker

struct ArrayOfStruct // expected-note{{within field of type 'ArrayOfStruct' declared here}}
{
struct ArrayOfPtr arr[3]; // expected-note{{within field of type 'struct ArrayOfPtr [3]' declared here}}
struct ArrayOfPtr arr[3]; // expected-note{{within field of type 'struct ArrayOfPtr[3]' declared here}}
};
kernel void array_of_struct(struct ArrayOfStruct arr) {} // expected-error{{struct kernel parameters may not contain pointers}}
2 changes: 1 addition & 1 deletion clang/test/SemaOpenCL/predefined-expr.cl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

void f() {
char *f1 = __func__; //expected-error-re{{initializing '{{__generic|__private}} char *__private' with an expression of type 'const __constant char *' changes address space of pointer}}
constant char *f2 = __func__; //expected-warning{{initializing '__constant char *__private' with an expression of type 'const __constant char [2]' discards qualifiers}}
constant char *f2 = __func__; //expected-warning{{initializing '__constant char *__private' with an expression of type 'const __constant char[2]' discards qualifiers}}
constant const char *f3 = __func__;
}
2 changes: 1 addition & 1 deletion clang/test/SemaOpenCLCXX/address-space-deduction.clcpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct x2 {
void foo(x1<T>* xx) {
m[0] = *xx;
}
//CHECK: -FieldDecl {{.*}} m 'x1<int> [2]'
//CHECK: -FieldDecl {{.*}} m 'x1<int>[2]'
x1<T> m[2];
};

Expand Down
10 changes: 5 additions & 5 deletions clang/test/SemaTemplate/deduction-guide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using AT = A<int[3], int, int, short>;
// CHECK: | |-ParmVarDecl {{.*}} 'X<Ps...>'
// CHECK: | `-ParmVarDecl {{.*}} 'Ts (*)[Ns]...' pack
// CHECK: `-CXXDeductionGuideDecl
// CHECK: |-TemplateArgument type 'int [3]'
// CHECK: |-TemplateArgument type 'int[3]'
// CHECK: |-TemplateArgument pack
// CHECK: | |-TemplateArgument type 'int'
// CHECK: | |-TemplateArgument type 'int'
Expand All @@ -34,9 +34,9 @@ using AT = A<int[3], int, int, short>;
// CHECK: | `-TemplateArgument integral 4
// CHECK: |-TemplateArgument pack
// CHECK: | |-TemplateArgument decl
// CHECK: | | `-Var {{.*}} 'arr1' 'int [3]'
// CHECK: | | `-Var {{.*}} 'arr1' 'int[3]'
// CHECK: | `-TemplateArgument decl
// CHECK: | `-Var {{.*}} 'arr2' 'int [3]'
// CHECK: | `-Var {{.*}} 'arr2' 'int[3]'
// CHECK: |-ParmVarDecl {{.*}} 'X<&arr1, &arr2>':'X<&arr1, &arr2>'
// CHECK: |-ParmVarDecl {{.*}} 'int (*)[3]'
// CHECK: |-ParmVarDecl {{.*}} 'int (*)[3]'
Expand All @@ -49,8 +49,8 @@ using AT = A<int[3], int, int, short>;
// CHECK: | `-DeclRefExpr {{.*}} 'T *' NonTypeTemplateParm {{.*}} 'Ps' 'T *'
// CHECK: `-PackExpansionType {{.*}} 'Ts (*)[Ns]...' dependent
// CHECK: `-PointerType {{.*}} 'Ts (*)[Ns]' dependent contains_unexpanded_pack
// CHECK: `-ParenType {{.*}} 'Ts [Ns]' sugar dependent contains_unexpanded_pack
// CHECK: `-DependentSizedArrayType {{.*}} 'Ts [Ns]' dependent contains_unexpanded_pack
// CHECK: `-ParenType {{.*}} 'Ts[Ns]' sugar dependent contains_unexpanded_pack
// CHECK: `-DependentSizedArrayType {{.*}} 'Ts[Ns]' dependent contains_unexpanded_pack
// CHECK: |-TemplateTypeParmType {{.*}} 'Ts' dependent contains_unexpanded_pack depth 0 index 1 pack
// CHECK: | `-TemplateTypeParm {{.*}} 'Ts'
// CHECK: `-DeclRefExpr {{.*}} 'Ts' NonTypeTemplateParm {{.*}} 'Ns' 'Ts...'
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaTemplate/instantiate-init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace PR7985 {
template<int N> struct integral_c { };

template <typename T, int N>
integral_c<N> array_lengthof(T (&x)[N]) { return integral_c<N>(); } // expected-note 2{{candidate template ignored: could not match 'T [N]' against 'const Data<}}
integral_c<N> array_lengthof(T (&x)[N]) { return integral_c<N>(); } // expected-note 2{{candidate template ignored: could not match 'T[N]' against 'const Data<}}

template<typename T>
struct Data {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaTemplate/instantiate-local-class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,15 @@ namespace rdar23721638 {

template <typename T> void foo() {
struct Inner { // expected-note {{in instantiation}}
void operator()(T a = "") {} // expected-error {{conversion function from 'const char [1]' to 'rdar23721638::A' invokes a deleted function}}
void operator()(T a = "") {} // expected-error {{conversion function from 'const char[1]' to 'rdar23721638::A' invokes a deleted function}}
// expected-note@-1 {{passing argument to parameter 'a' here}}
};
Inner()(); // expected-error {{type 'Inner' does not provide a call operator}}
}
template void foo<A>(); // expected-note 2 {{in instantiation}}

template <typename T> void bar() {
auto lambda = [](T a = "") {}; // expected-error {{conversion function from 'const char [1]' to 'rdar23721638::A' invokes a deleted function}}
auto lambda = [](T a = "") {}; // expected-error {{conversion function from 'const char[1]' to 'rdar23721638::A' invokes a deleted function}}
// expected-note@-1 {{passing argument to parameter 'a' here}}
lambda();
}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaTemplate/instantiate-static-var.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ namespace ArrayBound {
static const char kMessage[];
// Here, kMessage is type-dependent, so we don't diagnose until
// instantiation.
static void g1() { const char (&ref)[4] = kMessage; } // expected-error {{could not bind to an lvalue of type 'const char [5]'}}
static void g2() { const char (&ref)[5] = kMessage; } // expected-error {{could not bind to an lvalue of type 'const char [4]'}}
static void g1() { const char (&ref)[4] = kMessage; } // expected-error {{could not bind to an lvalue of type 'const char[5]'}}
static void g2() { const char (&ref)[5] = kMessage; } // expected-error {{could not bind to an lvalue of type 'const char[4]'}}
};
template<typename T> const char Bar<T>::kMessage[] = "foo";
template void Bar<int>::g1();
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaTemplate/pack-deduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace partial_full_mix {
// expected-note@-1 {{[with U = <char, double, long>]: pack expansion contains parameter pack 'U' that has a different length (2 vs. 3) from outer parameter packs}}

template<typename ...U> static tuple<U...> h(tuple<pair<T, U>..., pair<int, int>>);
// expected-note@-1 {{[with U = <int [2]>]: pack expansion contains parameter pack 'U' that has a different length (2 vs. 1) from outer parameter packs}}
// expected-note@-1 {{[with U = <int[2]>]: pack expansion contains parameter pack 'U' that has a different length (2 vs. 1) from outer parameter packs}}
};

pair<tuple<int, float>, tuple<char, double>> k1 = A<int, float>().f<char>(pair<int, char>(), pair<float, double>());
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaTemplate/temp_arg_nontype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace pr6249 {

namespace PR6723 {
template<unsigned char C> void f(int (&a)[C]); // expected-note 3{{candidate template ignored: substitution failure [with C = '\x00']}}
// expected-note@-1 {{not viable: no known conversion from 'int [512]' to 'int (&)[0]'}}
// expected-note@-1 {{not viable: no known conversion from 'int[512]' to 'int (&)[0]'}}
void g() {
int arr512[512];
f(arr512); // expected-error{{no matching function for call}}
Expand Down
10 changes: 5 additions & 5 deletions clang/unittests/AST/ASTImporterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ TEST_P(ImportExpr, ImportStringLiteral) {
testImport("void declToImport() { (void)\"foo\"; }", Lang_CXX03, "",
Lang_CXX03, Verifier,
functionDecl(hasDescendant(
stringLiteral(hasType(asString("const char [4]"))))));
stringLiteral(hasType(asString("const char[4]"))))));
testImport("void declToImport() { (void)L\"foo\"; }", Lang_CXX03, "",
Lang_CXX03, Verifier,
functionDecl(hasDescendant(
stringLiteral(hasType(asString("const wchar_t [4]"))))));
stringLiteral(hasType(asString("const wchar_t[4]"))))));
testImport("void declToImport() { (void) \"foo\" \"bar\"; }", Lang_CXX03, "",
Lang_CXX03, Verifier,
functionDecl(hasDescendant(
stringLiteral(hasType(asString("const char [7]"))))));
stringLiteral(hasType(asString("const char[7]"))))));
}

TEST_P(ImportExpr, ImportChooseExpr) {
Expand Down Expand Up @@ -508,8 +508,8 @@ TEST_P(ImportExpr, ImportPredefinedExpr) {
testImport("void declToImport() { (void)__func__; }", Lang_CXX03, "",
Lang_CXX03, Verifier,
functionDecl(hasDescendant(predefinedExpr(
hasType(asString("const char [13]")),
has(stringLiteral(hasType(asString("const char [13]"))))))));
hasType(asString("const char[13]")),
has(stringLiteral(hasType(asString("const char[13]"))))))));
}

TEST_P(ImportExpr, ImportInitListExpr) {
Expand Down
4 changes: 2 additions & 2 deletions clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ TEST_P(ASTMatchersTest, StmtExpr) {
TEST_P(ASTMatchersTest, PredefinedExpr) {
// __func__ expands as StringLiteral("foo")
EXPECT_TRUE(matches("void foo() { __func__; }",
predefinedExpr(hasType(asString("const char [4]")),
predefinedExpr(hasType(asString("const char[4]")),
has(stringLiteral()))));
}

Expand Down Expand Up @@ -1367,7 +1367,7 @@ TEST_P(ASTMatchersTest, ExprWithCleanups_MatchesExprWithCleanups) {

TEST_P(ASTMatchersTest, InitListExpr) {
EXPECT_TRUE(matches("int a[] = { 1, 2 };",
initListExpr(hasType(asString("int [2]")))));
initListExpr(hasType(asString("int[2]")))));
EXPECT_TRUE(matches("struct B { int x, y; }; struct B b = { 5, 6 };",
initListExpr(hasType(recordDecl(hasName("B"))))));
EXPECT_TRUE(
Expand Down
4 changes: 2 additions & 2 deletions clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ TEST(HasTypeLoc, MatchesClassTemplateSpecializationDecl) {

TEST(HasTypeLoc, MatchesCompoundLiteralExpr) {
EXPECT_TRUE(
matches("int* x = (int [2]) { 0, 1 };",
compoundLiteralExpr(hasTypeLoc(loc(asString("int [2]"))))));
matches("int* x = (int[2]) { 0, 1 };",
compoundLiteralExpr(hasTypeLoc(loc(asString("int[2]"))))));
}

TEST(HasTypeLoc, MatchesDeclaratorDecl) {
Expand Down
6 changes: 3 additions & 3 deletions compiler-rt/test/ubsan/TestCases/Misc/bounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int argc, char **argv) {
int arr[2][3][4] = {};

return arr[argv[1][0] - '0'][argv[2][0] - '0'][argv[3][0] - '0'];
// CHECK-A-2: bounds.cpp:[[@LINE-1]]:10: runtime error: index 2 out of bounds for type 'int [2][3][4]'
// CHECK-B-3: bounds.cpp:[[@LINE-2]]:10: runtime error: index 3 out of bounds for type 'int [3][4]'
// CHECK-C-4: bounds.cpp:[[@LINE-3]]:10: runtime error: index 4 out of bounds for type 'int [4]'
// CHECK-A-2: bounds.cpp:[[@LINE-1]]:10: runtime error: index 2 out of bounds for type 'int[2][3][4]'
// CHECK-B-3: bounds.cpp:[[@LINE-2]]:10: runtime error: index 3 out of bounds for type 'int[3][4]'
// CHECK-C-4: bounds.cpp:[[@LINE-3]]:10: runtime error: index 4 out of bounds for type 'int[4]'
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void test() {
LIBCPP_STATIC_ASSERT(!std::__default_initializable<const int>);
static_assert(!std::default_initializable<const int>);

const int x3[1]; // expected-error {{default initialization of an object of const type 'const int [1]'}}
const int x3[1]; // expected-error {{default initialization of an object of const type 'const int[1]'}}
const int y3[1]{};
static_assert(std::constructible_from<const int[1]>);
static_assert(brace_initializable<const int[1]>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
int main(int, char**) {
std::unique_ptr<int[]> p(new int(3));
const std::unique_ptr<int[]>& cp = p;
TEST_IGNORE_NODISCARD (*p); // expected-error {{indirection requires pointer operand ('std::unique_ptr<int []>' invalid)}}
TEST_IGNORE_NODISCARD (*cp); // expected-error {{indirection requires pointer operand ('const std::unique_ptr<int []>' invalid)}}
TEST_IGNORE_NODISCARD (*p); // expected-error {{indirection requires pointer operand ('std::unique_ptr<int[]>' invalid)}}
TEST_IGNORE_NODISCARD (*cp); // expected-error {{indirection requires pointer operand ('const std::unique_ptr<int[]>' invalid)}}

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ int main(int, char**) {
std::unique_ptr<V[]> p;
std::unique_ptr<V[]> const& cp = p;

p->member; // expected-error {{member reference type 'std::unique_ptr<V []>' is not a pointer}}
p->member; // expected-error {{member reference type 'std::unique_ptr<V[]>' is not a pointer}}
// expected-error@-1 {{no member named 'member'}}

cp->member; // expected-error {{member reference type 'const std::unique_ptr<V []>' is not a pointer}}
cp->member; // expected-error {{member reference type 'const std::unique_ptr<V[]>' is not a pointer}}
// expected-error@-1 {{no member named 'member'}}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Commands/CommandObjectType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ static bool FixArrayTypeNameWithRegex(ConstString &type_name) {
std::string type_name_str(type_name.GetCString());
type_name_str.resize(type_name_str.length() - 2);
if (type_name_str.back() != ' ')
type_name_str.append(" \\[[0-9]+\\]");
type_name_str.append(" ?\\[[0-9]+\\]");
else
type_name_str.append("\\[[0-9]+\\]");
type_name.SetCString(type_name_str.c_str());
Expand Down
4 changes: 3 additions & 1 deletion lldb/source/DataFormatters/FormatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ void FormatManager::LoadSystemFormatters() {
lldb::TypeSummaryImplSP string_array_format(
new StringSummaryFormat(string_array_flags, "${var%char[]}"));

RegularExpression any_size_char_arr(llvm::StringRef("char \\[[0-9]+\\]"));
RegularExpression any_size_char_arr(llvm::StringRef("char ?\\[[0-9]+\\]"));

TypeCategoryImpl::SharedPointer sys_category_sp =
GetCategory(m_system_category_name);
Expand Down Expand Up @@ -774,6 +774,8 @@ void FormatManager::LoadVectorFormatters() {
AddStringSummary(vectors_category_sp, "${var.uint128}",
ConstString("builtin_type_vec128"), vector_flags);

// FIXME: These probably need the space removed, or made optional - but are
// they even tested?
AddStringSummary(vectors_category_sp, "", ConstString("float [4]"),
vector_flags);
AddStringSummary(vectors_category_sp, "", ConstString("int32_t [4]"),
Expand Down
Loading