// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
char*t0(char*base,inta,intb){
returnbase+a*b;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:17: note: make conversion explicit to silence this warning
// CHECK-NOTES-C: (ptrdiff_t)( )
// CHECK-NOTES-CXX: static_cast<ptrdiff_t>( )
// CHECK-NOTES-ALL: :[[@LINE-5]]:17: note: perform multiplication in a wider type
// CHECK-NOTES-C: (ptrdiff_t)
// CHECK-NOTES-CXX: static_cast<ptrdiff_t>()
}
char*t1(char*base,inta,intb){
returna*b+base;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:10: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:10: note: perform multiplication in a wider type
}
char*t2(char*base,unsignedinta,intb){
returnbase+a*b;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'unsigned int' is used as a pointer offset after an implicit widening conversion to type 'size_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:17: note: make conversion explicit to silence this warning
// CHECK-NOTES-C: (size_t)( )
// CHECK-NOTES-CXX: static_cast<size_t>( )
// CHECK-NOTES-ALL: :[[@LINE-5]]:17: note: perform multiplication in a wider type
// CHECK-NOTES-C: (size_t)
// CHECK-NOTES-CXX: static_cast<size_t>()
}
char*t3(char*base,inta,unsignedintb){
returnbase+a*b;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'unsigned int' is used as a pointer offset after an implicit widening conversion to type 'size_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:17: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:17: note: perform multiplication in a wider type
}
char*t4(char*base,unsignedinta,unsignedintb){
returnbase+a*b;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'unsigned int' is used as a pointer offset after an implicit widening conversion to type 'size_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:17: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:17: note: perform multiplication in a wider type
}
char*t5(char*base,inta,intb,intc){
returnbase+a*b+c;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:17: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:17: note: perform multiplication in a wider type
}
char*t6(char*base,inta,intb,intc){
returnbase+a+b*c;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:21: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:21: note: perform multiplication in a wider type
}
char*n7(char*base,inta,intb){
returnbase+(a*b);
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:18: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:18: note: perform multiplication in a wider type
}
char*n8(char*base,inta,intb,intc){
returnbase+(a*b)+c;
// CHECK-NOTES-ALL: :[[@LINE-1]]:10: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t'
// CHECK-NOTES-ALL: :[[@LINE-2]]:18: note: make conversion explicit to silence this warning
// CHECK-NOTES-ALL: :[[@LINE-3]]:18: note: perform multiplication in a wider type