Fixed #6096: bool is an integral type, but there is no portability issue if a pointer is assigned to a bool.
This commit is contained in:
parent
274e1a838a
commit
417f42f732
|
@ -39,7 +39,7 @@ static bool isaddr(const Variable *var)
|
||||||
/** Is given variable an integer variable */
|
/** Is given variable an integer variable */
|
||||||
static bool isint(const Variable *var)
|
static bool isint(const Variable *var)
|
||||||
{
|
{
|
||||||
return (var && var->isIntegralType() && !var->isArrayOrPointer());
|
return (var && var->isIntegralType() && !var->isArrayOrPointer() && var->typeStartToken()->str() != "bool");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Check64BitPortability::pointerassignment()
|
void Check64BitPortability::pointerassignment()
|
||||||
|
|
|
@ -100,6 +100,12 @@ private:
|
||||||
" return 6 + p[2] * 256;\n"
|
" return 6 + p[2] * 256;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("int foo(int *p) {\n" // #6096
|
||||||
|
" bool a = p;\n"
|
||||||
|
" return a;\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void structmember() {
|
void structmember() {
|
||||||
|
|
Loading…
Reference in New Issue