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/test64bit.cpp
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -307,6 +307,23 @@ class Test64BitPortability : public TestFixture {
307
307
" return x.get();\n"
308
308
"}\n");
309
309
ASSERT_EQUALS("", errout_str());
310
+
311
+
check("int f(int* p) {\n"// #14294
312
+
" return (int)p;\n"
313
+
"}\n");
314
+
ASSERT_EQUALS("[test.cpp:2:5]: (portability) Returning an address value in a function with integer return type is not portable. [CastAddressToIntegerAtReturn]\n",
315
+
errout_str());
316
+
317
+
check("int f(int* p) {\n"
318
+
" return reinterpret_cast<int>(p);\n"
319
+
"}\n");
320
+
ASSERT_EQUALS("[test.cpp:2:5]: (portability) Returning an address value in a function with integer return type is not portable. [CastAddressToIntegerAtReturn]\n",
0 commit comments