You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testio.cpp
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2182,6 +2182,20 @@ class TestIO : public TestFixture {
2182
2182
"[test.cpp:6]: (warning) %lx in format string (no. 1) requires 'unsigned long' but the argument type is 'unsigned int'.\n"
2183
2183
"[test.cpp:7]: (warning) %llx in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned int'.\n", errout.str());
2184
2184
2185
+
check("void foo(int i, intmax_t im, ptrdiff_t p) {\n"
2186
+
" printf(\"%lld\", i);\n"
2187
+
" printf(\"%lld\", im);\n"
2188
+
" printf(\"%lld\", p);\n"
2189
+
"}");
2190
+
ASSERT_EQUALS("[test.cpp:2]: (warning) %lld in format string (no. 1) requires 'long long' but the argument type is 'signed int'.\n", errout.str());
2191
+
2192
+
check("void foo(intmax_t im, ptrdiff_t p) {\n"
2193
+
" printf(\"%lld\", im);\n"
2194
+
" printf(\"%lld\", p);\n"
2195
+
"}", false, true, Settings::Win64);
2196
+
ASSERT_EQUALS("[test.cpp:2]: (portability) %lld in format string (no. 1) requires 'long long' but the argument type is 'intmax_t {aka signed long long}'.\n"
2197
+
"[test.cpp:3]: (portability) %lld in format string (no. 1) requires 'long long' but the argument type is 'ptrdiff_t {aka signed long long}'.\n", errout.str());
0 commit comments