Lines Matching full:printf
28 printf("Hello");
29 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
34 printf("Hello\n");
35 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
38 printf("Split" "\n");
39 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
42 printf("Double\n\n");
43 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
48 printf("Hello\\n");
49 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
52 printf("Hello\x0a");
53 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
58 printf("Hello\r\n");
59 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
62 printf("Hello\r\\n");
63 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
70 const int i = printf("Return value assigned to variable %d\n", 42);
73 accepts_int(printf("Return value passed to function %d\n", 42));
76 printf("if body %d\n", i);
77 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
80 printf("else if body %d\n", i);
81 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
84 printf("else body %d\n", i);
85 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
88 if (printf("Return value used as boolean in if statement"))
89 if (printf("Return value used in expression if statement") == 44)
90 if (const int j = printf("Return value used in assignment in if statement"))
91 if (const int k = printf("Return value used with initializer in if statement"); k == 44)
95 while (printf("%d", d) < 2)
99 printf("while body %d\n", i);
100 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
104 printf("do body %d\n", i);
105 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
110 printf("for body %d\n", i);
111 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
114 for (printf("for init statement %d\n", i);;)
115 // CHECK-MESSAGES: [[@LINE-1]]:8: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
119 for (int j = printf("for init statement %d\n", i);;)
122 for (; printf("for condition %d\n", i);)
125 for (;; printf("for expression %d\n", i))
126 // CHECK-MESSAGES: [[@LINE-1]]:11: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
131 printf("ranged-for body %d\n", i);
132 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
137 printf("switch case body %d\n", i);
138 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
142 printf("switch default body %d\n", i);
143 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
149 printf("try body %d\n", i);
150 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
153 printf("catch body %d\n", i);
154 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
158 (printf("Parenthesised expression %d\n", i));
159 // CHECK-MESSAGES: [[@LINE-1]]:4: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
164 (void)printf("cast to void %d\n", i);
165 // CHECK-MESSAGES-NOT: [[@LINE-1]]:9: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
168 static_cast<void>(printf("static_cast to void %d\n", i));
169 // CHECK-MESSAGES-NOT: [[@LINE-1]]:9: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
172 const int x = ({ printf("GCC statement expression using return value immediately %d\n", i); });
173 const int y = ({ const int y = printf("GCC statement expression using return value immediately %d\n", i); y; });
177 ({ printf("GCC statement expression with unused result %d\n", i); });
178 // CHECK-MESSAGES-NOT: [[@LINE-1]]:6: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
181 return printf("Return value used in return\n");
274 (printf("Parenthesised expression %d\n", i));
275 // CHECK-MESSAGES: [[@LINE-1]]:4: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
307 std::printf("std::Hello");
308 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
313 printf("before \t");
314 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
317 printf("\n after");
318 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
321 printf("before \a after");
322 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
325 printf("Bell\a%dBackspace\bFF%s\fNewline\nCR\rTab\tVT\vEscape\x1b\x07%d", 42, "string", 99);
326 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
329 printf("not special \x1b\x01\x7f");
330 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
335 printf("before %%");
336 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
339 printf("%% after");
340 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
343 printf("before %% after");
344 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
347 printf("Hello %% and another %%");
348 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
351 printf("Not a string %%s");
352 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
357 printf("%d {}", 42);
358 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
361 printf("{}");
362 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
368 printf("%d %n %d\n", 42, &pos, 72);
369 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::println' instead of 'printf' because '%n' is not supported in format string [modernize-use-std-print]
371 printf("Error %m\n");
372 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::println' instead of 'printf' because '%m' is not supported in format string [modernize-use-std-print]
377 printf(fmt, 42);
386 printf("uint64:%" PRId64 " uintmax:%" PRIuMAX "\n", u64, umax);
387 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
393 printf(R"(First\Second)");
394 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
399 printf(R"(First %d\Second)", 42);
400 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
406 // The "d" type is necessary here for compatibility with printf since
408 printf("Integer %d from bool\n", b);
409 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
412 // The "d" type is necessary here for compatibility with printf since
414 printf("Integer %i from bool\n", b);
415 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
420 // cast is always necessary to maintain the printf behaviour since
424 printf("Integers %d %hhd from char\n", c, c);
425 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
429 printf("Integers %i %hhi from char\n", c, c);
430 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
435 printf("Integers %d %hhd from signed char\n", sc, sc);
436 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
439 printf("Integers %i %hhi from signed char\n", sc, sc);
440 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
444 printf("Integers %d %hhd from unsigned char\n", uc, uc);
445 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
449 printf("Integers %i %hhi from unsigned char\n", uc, uc);
450 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
455 printf("Integer %" PRIi8 " from int8_t\n", i8);
456 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
460 printf("Integer %" PRIiFAST8 " from int_fast8_t\n", if8);
461 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
465 printf("Integer %" PRIiFAST8 " from int_least8_t\n", il8);
466 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
471 printf("Integers %" PRIi8 " and %" PRId8 " from uint8_t\n", u8, su8);
472 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
477 printf("Integer %" PRIiFAST8 " from uint_fast8_t\n", uf8);
478 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
483 printf("Integer %" PRIiLEAST8 " from uint_least8_t\n", ul8);
484 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
489 printf("Integer %hd from short\n", s);
490 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
493 printf("Integer %hi from short\n", s);
494 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
498 printf("Integer %hd from unsigned short\n", us);
499 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
503 printf("Integer %hi from unsigned short\n", us);
504 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
509 printf("Integer %d from integer\n", i);
510 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
513 printf("Integer %i from integer\n", i);
514 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
518 printf("Integer %d from unsigned integer\n", ui);
519 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
523 printf("Integer %i from unsigned integer\n", ui);
524 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
529 printf("Integer %ld from long\n", l);
530 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
533 printf("Integer %li from long\n", l);
534 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
538 printf("Integer %ld from unsigned long\n", ul);
539 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
543 printf("Integer %li from unsigned long\n", ul);
544 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
549 printf("Integer %lld from long long\n", ll);
550 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
553 printf("Integer %lli from long long\n", ll);
554 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
558 printf("Integer %lld from unsigned long long\n", ull);
559 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
563 printf("Integer %lli from unsigned long long\n", ull);
564 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
570 printf("Integers %jd and %jd from intmax_t\n", im, sim);
571 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
574 printf("Integers %ji and %ji from intmax_t\n", im, sim);
575 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
580 printf("Integers %jd and %jd from uintmax_t\n", uim, suim);
581 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
585 printf("Integer %ji from intmax_t\n", uim);
586 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
593 printf("Integers %td and %td from ptrdiff_t\n", pd, spd);
594 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
597 printf("Integers %ti and %ti from ptrdiff_t\n", pd, spd);
598 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
603 printf("Integers %zd and %zd from size_t\n", z, sz);
604 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
612 // The "d" type is necessary here for compatibility with printf since
614 printf("Unsigned integer %u from bool\n", b);
615 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
619 printf("Unsigned integer %hhu from char\n", c);
620 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
625 printf("Unsigned integer %hhu from signed char\n", sc);
626 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
630 printf("Unsigned integer %u from signed char\n", sc);
631 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
636 printf("Unsigned integer %hhu from unsigned char\n", uc);
637 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
640 printf("Unsigned integer %u from unsigned char\n", uc);
641 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
645 printf("Unsigned integer %" PRIu8 " from int8_t\n", i8);
646 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
651 printf("Unsigned integer %" PRIuFAST8 " from int_fast8_t\n", if8);
652 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
657 printf("Unsigned integer %" PRIuFAST8 " from int_least8_t\n", il8);
658 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
663 printf("Unsigned integer %" PRIu8 " from uint8_t\n", u8);
664 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
668 printf("Unsigned integer %" PRIuFAST8 " from uint_fast8_t\n", uf8);
669 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
673 printf("Unsigned integer %" PRIuLEAST8 " from uint_least8_t\n", ul8);
674 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
678 printf("Unsigned integer %hu from short\n", s);
679 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
684 printf("Unsigned integer %hu from unsigned short\n", us);
685 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
689 printf("Unsigned integer %u from signed integer\n", i);
690 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
695 printf("Unsigned integer %u from unsigned integer\n", ui);
696 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
700 printf("Unsigned integer %u from signed long\n", l);
701 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
706 printf("Unsigned integer %lu from unsigned long\n", ul);
707 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
711 printf("Unsigned integer %llu from long long\n", ll);
712 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
717 printf("Unsigned integer %llu from unsigned long long\n", ull);
718 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
723 printf("Unsigned integers %ju and %ju from intmax_t\n", im, sim);
724 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
730 printf("Unsigned integers %ju and %ju from uintmax_t\n", uim, suim);
731 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
737 printf("Unsigned integers %tu and %tu from ptrdiff_t\n", pd, spd);
738 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
744 printf("Unsigned integers %zu and %zu from size_t\n", z, sz);
745 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
772 printf("Char %c from char\n", c);
773 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
777 printf("Char %c from signed char\n", sc);
778 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
782 printf("Char %c from unsigned char\n", uc);
783 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
787 printf("Char %c from integer\n", i);
788 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
792 printf("Char %c from unsigned integer\n", ui);
793 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
797 printf("Char %c from unsigned long long\n", ull);
798 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
803 printf("Hex %lx\n", 42L);
804 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
807 printf("HEX %X\n", 42);
808 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
811 printf("Oct %lo\n", 42L);
812 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
817 printf("Hex %#lx\n", 42L);
818 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
821 printf("HEX %#X\n", 42);
822 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
825 printf("Oct %#lo\n", 42L);
826 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
829 printf("Double %#f %#F\n", -42.0, -42.0);
830 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
833 printf("Double %#g %#G\n", -42.0, -42.0);
834 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
837 printf("Double %#e %#E\n", -42.0, -42.0);
838 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
841 printf("Double %#a %#A\n", -42.0, -42.0);
842 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
846 printf("Char %#c\n", 'A');
847 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
851 printf("Char %#c\n", 'A');
852 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
857 printf("Hello %s after\n", "Goodbye");
858 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
863 printf("signed char string %s\n", sstring);
864 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
869 printf("unsigned char string %s\n", ustring);
870 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
877 // maintain compatibility with printf.
879 // TODO: Should we force a cast here, since printf will promote to double
884 printf("Hello %f after\n", f);
885 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
888 printf("Hello %g after\n", f);
889 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
892 printf("Hello %e after\n", f);
893 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
900 // maintain compatibility with printf.
903 printf("Hello %f after\n", d);
904 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
907 printf("Hello %g after\n", d);
908 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
911 printf("Hello %e after\n", d);
912 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
919 // maintain compatibility with printf.
922 printf("Hello %Lf after\n", ld);
923 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
926 printf("Hello %g after\n", ld);
927 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
930 printf("Hello %e after\n", ld);
931 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
938 printf("Int* %p %s %p\n", &i, "Double*", &j);
939 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
942 printf("%p\n", nullptr);
943 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
947 printf("%p\n", np);
948 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
952 printf("%p\n", NULL);
953 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
956 printf("%p\n", 42);
957 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
961 printf("%p\n", reinterpret_cast<const void *>(44));
962 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
966 printf("%p\n", p);
967 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
972 printf("%p\n", pp);
973 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
976 printf("%p\n", printf_pointer);
977 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
987 printf("%p\n", this);
988 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
994 printf("%p\n", &AClass::printf_pointer_to_member_function);
995 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1001 printf("%p\n", &AClass::member);
1002 // CHECK-MESSAGES: [[@LINE-1]]:5: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1008 printf("%1$d", 42);
1009 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1012 printf("before %1$d", 42);
1013 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1016 printf("%1$d after", 42);
1017 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1020 printf("before %1$d after", 42);
1021 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1024 printf("before %2$d between %1$s after", "string", 42);
1025 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1029 // printf always defaults to right justification,, no matter what the type is of
1033 printf("Right-justified integer %4d after\n", 42);
1034 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1037 printf("Right-justified double %4f\n", 227.2);
1038 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1041 printf("Right-justified double %4g\n", 227.4);
1042 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1045 printf("Right-justified integer with field width argument %*d after\n", 5, 424242);
1046 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1049 printf("Right-justified integer with field width argument %2$*1$d after\n", 5, 424242);
1050 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1053 printf("Right-justified string %20s\n", "Hello");
1054 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1057 printf("Right-justified string with field width argument %2$*1$s after\n", 20, "wibble");
1058 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1062 // printf always requires - for left justification, no matter what the type is
1066 printf("Left-justified integer %-4d\n", 42);
1067 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1070 printf("Left-justified integer %--4d\n", 42);
1071 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1074 printf("Left-justified double %-4f\n", 227.2);
1075 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1078 printf("Left-justified double %-4g\n", 227.4);
1079 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1082 printf("Left-justified integer with field width argument %-*d after\n", 5, 424242);
1083 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1086 printf("Left-justified integer with field width argument %2$-*1$d after\n", 5, 424242);
1087 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1090 printf("Left-justified string %-20s\n", "Hello");
1091 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1094 printf("Left-justified string with field width argument %2$-*1$s after\n", 5, "wibble");
1095 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1100 printf("Hello %.3f\n", 3.14159);
1101 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1104 printf("Hello %10.3f\n", 3.14159);
1105 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1108 printf("Hello %.*f after\n", 10, 3.14159265358979323846);
1109 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1112 printf("Hello %10.*f after\n", 3, 3.14159265358979323846);
1113 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1116 printf("Hello %*.*f after\n", 10, 4, 3.14159265358979323846);
1117 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1120 printf("Hello %1$.*2$f after\n", 3.14159265358979323846, 4);
1121 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1125 printf("Hello %.5s\n", "Goodbye");
1126 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1129 printf("Hello %.5c\n", 'G');
1130 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1136 printf("width only:%*d width and precision:%*.*f precision only:%.*f\n", 3, 42, 4, 2, 3.14159265358979323846, 5, 2.718);
1137 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1141 printf("casts width only:%*d width and precision:%*.*d precision only:%.*d\n", 3, ui1, 4, 2, ui2, 5, ui3);
1142 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1146 printf("c_str removal width only:%*s width and precision:%*.*s precision only:%.*s\n", 3, s1.c_str(), 4, 2, s2.c_str(), 5, s3.c_str());
1147 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1151 printf("c_str() removal pointer width only:%-*s width and precision:%-*.*s precision only:%-.*s\n", 3, ps1->c_str(), 4, 2, ps2->c_str(), 5, ps3->c_str());
1152 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1156 printf("c_str() removal iterator width only:%-*s width and precision:%-*.*s precision only:%-.*s\n", 3, is1->c_str(), 4, 2, is2->c_str(), 5, is3->c_str());
1157 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1160 printf("width and precision positional:%1$*2$.*3$f after\n", 3.14159265358979323846, 4, 2);
1161 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1165 printf("width only:%3$*1$d width and precision:%4$*1$.*2$f precision only:%5$.*2$f\n", width, precision, 42, 3.1415926, 2.718);
1166 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1169 printf("c_str removal width only:%3$*1$s width and precision:%4$*1$.*2$s precision only:%5$.*2$s\n", width, precision, s1.c_str(), s2.c_str(), s3.c_str());
1170 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1208 printf("Wibble %#x\n", 42);
1209 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1212 printf("Wibble %#20x\n", 42);
1213 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1216 printf("Wibble %#020x\n", 42);
1217 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1220 printf("Wibble %#-20x\n", 42);
1221 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1226 printf("Positive integer %+d\n", 42);
1227 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1230 printf("Positive double %+f\n", 42.2);
1231 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1234 printf("Positive double %+g\n", 42.2);
1235 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1239 // printf would have just ignored it.
1240 printf("Positive string %+s\n", "string");
1241 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1246 printf("Spaced integer % d\n", 42);
1247 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1250 printf("Spaced integer %- d\n", 42);
1251 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1254 printf("Spaced double % f\n", 42.2);
1255 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1258 printf("Spaced double % g\n", 42.2);
1259 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1264 printf("Leading zero integer %03d\n", 42);
1265 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1268 printf("Leading minus and zero integer %-03d minus ignored\n", 42);
1269 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1272 printf("Leading zero unsigned integer %03u\n", 42U);
1273 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1276 printf("Leading zero double %03f\n", 42.2);
1277 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1280 printf("Leading zero double %03g\n", 42.2);
1281 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1286 // printf prefers plus to space. {fmt} will throw if both are present.
1287 printf("Spaced integer % +d\n", 42);
1288 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1291 printf("Spaced double %+ f\n", 42.2);
1292 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1295 printf("Spaced double % +g\n", 42.2);
1296 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1301 printf("Leading zero integer %+03d\n", 42);
1302 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1305 printf("Leading zero double %0+3f\n", 42.2);
1306 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1309 printf("Leading zero double %0+3g\n", 42.2);
1310 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1315 printf("Leading zero and space integer %0 3d\n", 42);
1316 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1319 printf("Leading zero and space double %0 3f\n", 42.2);
1320 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1323 printf("Leading zero and space double %0 3g\n", 42.2);
1324 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1346 printf("%d", plain_enum);
1347 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1351 printf("%d", splain_enum);
1352 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1356 printf("%d", bool_enum);
1357 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1361 printf("%d", char_enum);
1362 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1366 printf("%d", schar_enum);
1367 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1371 printf("%d", uchar_enum);
1372 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1376 printf("%d", short_enum);
1377 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1381 printf("%d", ushort_enum);
1382 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1386 printf("%d", int_enum);
1387 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1391 printf("%d", uint_enum);
1392 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1396 printf("%d", long_enum);
1397 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1401 printf("%d", ulong_enum);
1402 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1406 printf("%d", longlong_enum);
1407 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1411 printf("%d", ulonglong_enum);
1412 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1418 printf("%u", plain_enum);
1419 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1423 printf("%u", splain_enum);
1424 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1428 printf("%u", bool_enum);
1429 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1433 printf("%u", char_enum);
1434 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1438 printf("%u", schar_enum);
1439 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1443 printf("%u", uchar_enum);
1444 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1448 printf("%u", short_enum);
1449 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1453 printf("%u", ushort_enum);
1454 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1458 printf("%u", int_enum);
1459 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1463 printf("%u", uint_enum);
1464 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1468 printf("%u", long_enum);
1469 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1473 printf("%u", ulong_enum);
1474 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1478 printf("%u", longlong_enum);
1479 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1483 printf("%u", ulonglong_enum);
1484 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1489 printf("printf string from callback %s", callback());
1490 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1491 // CHECK-FIXES: std::print("printf string from callback {}", callback());
1501 printf("printf string from member function %s", x.str());
1502 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1503 // CHECK-FIXES: std::print("printf string from member function {}", x.str());
1505 printf("printf string from member function on const %s", cx.str());
1506 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1507 // CHECK-FIXES: std::print("printf string from member function on const {}", cx.str());
1511 printf("printf string one c_str %s", s1.c_str());
1512 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1513 // CHECK-FIXES: std::print("printf string one c_str {}", s1);
1515 printf("printf string two c_str %s %s\n", s1.c_str(), s2.data());
1516 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1517 // CHECK-FIXES: std::println("printf string two c_str {} {}", s1, s2);
1526 printf("printf bogus wstring c_str %s", ws1.c_str());
1527 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1528 // CHECK-FIXES: std::print("printf bogus wstring c_str {}", ws1.c_str());
1538 printf("printf string pointer one c_str %s", s1->c_str());
1539 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1540 // CHECK-FIXES: std::print("printf string pointer one c_str {}", *s1);
1542 printf("printf string pointer two c_str %s %s\n", s1->c_str(), s2->data());
1543 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1544 // CHECK-FIXES: std::println("printf string pointer two c_str {} {}", *s1, *s2);
1555 printf("printf iterator c_str %s %s\n", i1->c_str(), i2->data());
1556 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1557 // CHECK-FIXES: std::println("printf iterator c_str {} {}", *i1, *i2);
1561 // be removed even though the printf call will be replaced.
1570 printf("Not std::string %s %s", s1.c_str(), s2->c_str());
1571 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1574 printf("Not std::string %s %s", s1.data(), s2->data());
1575 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1589 printf("Replaceable macro at end %" PRIu64, u64);
1590 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1593 printf("Replaceable macros in middle %" PRIu64 " %" PRIu32 "\n", u64, u32);
1594 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
1597 printf("Unreplaceable macro at end %" PRI_FMT_MACRO, s);
1598 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro 'PRI_FMT_MACRO' [modernize-use-std-print]
1600 printf(PRI_FMT_MACRO " Unreplaceable macro at beginning %s", s);
1601 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro 'PRI_FMT_MACRO' [modernize-use-std-print]
1603 printf("Unreplacemable macro %" __PRI_FMT_MACRO " in the middle", s);
1604 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro '__PRI_FMT_MACRO' [modernize-use-std-print]
1606 printf("First macro is replaceable %" PRIu64 " but second one is not %" PRI_FMT_MACRO, u64, s);
1607 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro 'PRI_FMT_MACRO' [modernize-use-std-print]
1610 printf(" macro from command line %" PRI_CMDLINE_MACRO, s);
1611 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro 'PRI_CMDLINE_MACRO' [modernize-use-std-print]
1614 printf(" macro from command line %" __PRI_CMDLINE_MACRO, s);
1615 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro '__PRI_CMDLINE_MACRO' [modernize-use-std-print]
1621 SURROUND_ALL(printf("Macro surrounding entire invocation %" PRIu64, u64));
1622 // CHECK-MESSAGES: [[@LINE-1]]:16: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1627 SURROUND_ALL(printf("Macro surrounding entire invocation with unreplaceable macro %" PRI_FMT_MACRO, s));
1628 // CHECK-MESSAGES: [[@LINE-1]]:16: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro 'PRI_FMT_MACRO' [modernize-use-std-print]
1633 SURROUND_FUNCTION_NAME(printf)("Hello %d", 4442);
1634 // CHECK-MESSAGES: [[@LINE-1]]:26: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
1640 printf(SURROUND_FORMAT("Hello %d"), 4443);
1641 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: unable to use 'std::print' instead of 'printf' because format string contains unreplaceable macro 'SURROUND_FORMAT' [modernize-use-std-print]