@@ -78,13 +78,13 @@ void f12(std::int8_t x) {}
7878
7979template <typename T> void f5 (T x) { unsigned char y = x; }
8080template <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; }
8282template <typename T> void f8 (T x) { signed char y = x; }
8383
8484/* Twin template functions for std::uint8_t and std::int8_t */
8585template <typename T> void f13 (T x) { std::uint8_t y = x; }
8686template <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; }
8888template <typename T> void f16 (T x) { std::int8_t y = x; }
8989
9090template <typename T> class C9 {
@@ -286,33 +286,33 @@ int main() {
286286 /* ===== 2-2. Passing char argument to a char parameter through a template
287287 * ===== */
288288
289- unsigned char a9 = ' a ' ;
289+ unsigned char a9 = 1 ;
290290 f5 (a9); // COMPLIANT: unsigned char arg passed to an unsigned char parameter
291291 // through a template
292292
293- signed char a10 = ' a ' ;
293+ signed char a10 = 1 ;
294294 f6 (a10); // COMPLIANT: signed char arg passed to a signed char parameter
295295 // through a template
296296
297297 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
299299 // through a template
300300
301301 char a12 = ' a' ;
302302 f8 (a12); // NON-COMPLIANT: plain char arg passed to a signed char parameter through
303303 // a template
304304
305305 /* Twin cases with std::uint8_t and std::int8_t */
306- std::uint8_t a13 = ' a ' ;
306+ std::uint8_t a13 = 1 ;
307307 f13 (a13); // COMPLIANT: std::uint8_t arg passed to a std::uint8_t parameter
308308 // through a template
309309
310- std::int8_t a14 = ' a ' ;
310+ std::int8_t a14 = 1 ;
311311 f14 (a14); // COMPLIANT: std::int8_t arg passed to a std::int8_t parameter
312312 // through a template
313313
314314 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
316316 // through a template
317317
318318 char a16 = ' a' ;
0 commit comments