Commit 6175f578 by Andrew Pinski Committed by Andrew Pinski

re PR c++/36607 (Incorrect type diagnostic on substracting casted char pointers)

2009-02-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C++/36607
        * convert.c (convert_to_integer): Treat OFFSET_TYPE like INTEGER_TYPE.

2009-02-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C++/36607
        * g++.dg/expr/cast10.C: New test.

From-SVN: r143909
parent d4f4bc84
2009-02-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/36607
* convert.c (convert_to_integer): Treat OFFSET_TYPE like INTEGER_TYPE.
2009-02-03 Jakub Jelinek <jakub@redhat.com>
* gcc.c (process_command): Update copyright notice dates.
......
......@@ -493,6 +493,7 @@ convert_to_integer (tree type, tree expr)
case INTEGER_TYPE:
case ENUMERAL_TYPE:
case BOOLEAN_TYPE:
case OFFSET_TYPE:
/* If this is a logical operation, which just returns 0 or 1, we can
change the type of the expression. */
......
2009-02-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/36607
* g++.dg/expr/cast10.C: New test.
2009-02-03 Joseph Myers <joseph@codesourcery.com>
PR c/35433
......
// { dg-do compile }
// This used to error out because we would try to convert m to a short.
struct a {};
void b() {
int a::*m;
a *c;
short p = reinterpret_cast<char*>(&(c->*m)) - reinterpret_cast<char*>(c);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment