@@ -78,13 +78,13 @@ void f12(std::int8_t x) {}
78
78
79
79
template <typename T> void f5 (T x) { unsigned char y = x; }
80
80
template <typename T> void f6 (T x) { signed char y = x; }
81
- template <typename T> void f7 (T x) { signed char y = x; }
81
+ template <typename T> void f7 (T x) { unsigned char y = x; }
82
82
template <typename T> void f8 (T x) { signed char y = x; }
83
83
84
84
/* Twin template functions for std::uint8_t and std::int8_t */
85
85
template <typename T> void f13 (T x) { std::uint8_t y = x; }
86
86
template <typename T> void f14 (T x) { std::int8_t y = x; }
87
- template <typename T> void f15 (T x) { std::int8_t y = x; }
87
+ template <typename T> void f15 (T x) { std::uint8_t y = x; }
88
88
template <typename T> void f16 (T x) { std::int8_t y = x; }
89
89
90
90
template <typename T> class C9 {
@@ -286,33 +286,33 @@ int main() {
286
286
/* ===== 2-2. Passing char argument to a char parameter through a template
287
287
* ===== */
288
288
289
- unsigned char a9 = ' a ' ;
289
+ unsigned char a9 = 1 ;
290
290
f5 (a9); // COMPLIANT: unsigned char arg passed to an unsigned char parameter
291
291
// through a template
292
292
293
- signed char a10 = ' a ' ;
293
+ signed char a10 = 1 ;
294
294
f6 (a10); // COMPLIANT: signed char arg passed to a signed char parameter
295
295
// through a template
296
296
297
297
char a11 = ' a' ;
298
- f7 (a11); // NON-COMPLIANT: plain char arg passed to a signed char parameter
298
+ f7 (a11); // NON-COMPLIANT: plain char arg passed to an unsigned char parameter
299
299
// through a template
300
300
301
301
char a12 = ' a' ;
302
302
f8 (a12); // NON-COMPLIANT: plain char arg passed to a signed char parameter through
303
303
// a template
304
304
305
305
/* Twin cases with std::uint8_t and std::int8_t */
306
- std::uint8_t a13 = ' a ' ;
306
+ std::uint8_t a13 = 1 ;
307
307
f13 (a13); // COMPLIANT: std::uint8_t arg passed to a std::uint8_t parameter
308
308
// through a template
309
309
310
- std::int8_t a14 = ' a ' ;
310
+ std::int8_t a14 = 1 ;
311
311
f14 (a14); // COMPLIANT: std::int8_t arg passed to a std::int8_t parameter
312
312
// through a template
313
313
314
314
char a15 = ' a' ;
315
- f15 (a15); // NON-COMPLIANT: plain char arg passed to a std::int8_t parameter
315
+ f15 (a15); // NON-COMPLIANT: plain char arg passed to a std::uint8_t parameter
316
316
// through a template
317
317
318
318
char a16 = ' a' ;
0 commit comments