File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -464,6 +464,8 @@ void CheckOtherImpl::warningIntToPointerCast()
464464 format = " decimal" ;
465465 else if (MathLib::isOct (from->str ()))
466466 format = " octal" ;
467+ else if (MathLib::isBin (from->str ()))
468+ format = " binary" ;
467469 else
468470 continue ;
469471 intToPointerCastError (tok, format);
Original file line number Diff line number Diff line change @@ -2362,6 +2362,9 @@ class TestOther : public TestFixture {
23622362 checkIntToPointerCast("struct S { int i; };\n" // #13886, don't crash
23632363 "int f() { return sizeof(((struct S*)0)->i); }");
23642364 ASSERT_EQUALS("", errout_str());
2365+
2366+ checkIntToPointerCast("auto p = (int*)0b10;"); // #14180
2367+ ASSERT_EQUALS("[test.cpp:1:10]: (portability) Casting non-zero binary integer literal to pointer. [intToPointerCast]\n", errout_str());
23652368 }
23662369
23672370 struct CheckInvalidPointerCastOptions
You can’t perform that action at this time.
0 commit comments