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
This commit is contained in:
parent
d4f4bc84b0
commit
6175f5785a
@ -1,3 +1,8 @@
|
||||
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. */
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
10
gcc/testsuite/g++.dg/expr/cast10.C
Normal file
10
gcc/testsuite/g++.dg/expr/cast10.C
Normal file
@ -0,0 +1,10 @@
|
||||
// { 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user