mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-19 02:00:54 +08:00
re PR c/45584 (typeof with casting from const to non-const does not work properly)
2014-08-19 Patrick Palka <ppalka@gcc.gnu.org> PR c/45584 * c-typeck.c (build_c_cast): Do a conversion even when the TYPE_MAIN_VARIANTs are the same. 2014-08-19 Patrick Palka <ppalka@gcc.gnu.org> PR c/45584 * gcc.dg/pr13519-1.c: Adjust. From-SVN: r214151
This commit is contained in:
parent
d207703088
commit
c77935ee29
@ -1,3 +1,9 @@
|
||||
2014-08-19 Patrick Palka <ppalka@gcc.gnu.org>
|
||||
|
||||
PR c/45584
|
||||
* c-typeck.c (build_c_cast): Do a conversion even when the
|
||||
TYPE_MAIN_VARIANTs are the same.
|
||||
|
||||
2014-08-19 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* c-decl.c (diagnose_mismatched_decls): Unconditionally call
|
||||
|
@ -4947,6 +4947,9 @@ build_c_cast (location_t loc, tree type, tree expr)
|
||||
|| TREE_CODE (type) == UNION_TYPE)
|
||||
pedwarn (loc, OPT_Wpedantic,
|
||||
"ISO C forbids casting nonscalar to the same type");
|
||||
|
||||
/* Convert to remove any qualifiers from VALUE's type. */
|
||||
value = convert (type, value);
|
||||
}
|
||||
else if (TREE_CODE (type) == UNION_TYPE)
|
||||
{
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-08-19 Patrick Palka <ppalka@gcc.gnu.org>
|
||||
|
||||
PR c/45584
|
||||
* gcc.dg/pr13519-1.c: Adjust.
|
||||
|
||||
2014-08-19 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* gcc.dg/guality/const-volatile.c: Add `used' attribute to pi.
|
||||
@ -7,7 +12,7 @@
|
||||
PR debug/59051
|
||||
* gcc.dg/guality/restrict.c: New test.
|
||||
|
||||
2014-07-03 Mark Wielaard <mjw@redhat.com>
|
||||
2014-08-19 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* lib/gcc-gdb-test.exp (gdb-test): Handle type:var for gdb ptype
|
||||
matching. Catch '<unknown type in ' to recognize older gdb versions.
|
||||
|
@ -14,9 +14,9 @@ void fn(void)
|
||||
{ __typeof__(n) a1; a1=0; }
|
||||
{ __typeof__(c) a2; a2=0; } /* { dg-error "read-only" "correct error" } */
|
||||
{ __typeof__((int)n) a3; a3=0; }
|
||||
{ __typeof__((int)c) a4; a4=0; } /* { dg-bogus "read-only" "bogus error" { xfail *-*-* } } */
|
||||
{ __typeof__((const int)n) a5; a5=0; } /* { dg-error "read-only" "correct error" { xfail *-*-* } } */
|
||||
{ __typeof__((const int)c) a6; a6=0; } /* { dg-error "read-only" "correct error" } */
|
||||
{ __typeof__((int)c) a4; a4=0; } /* { dg-bogus "read-only" "bogus error" } */
|
||||
{ __typeof__((const int)n) a5; a5=0; }
|
||||
{ __typeof__((const int)c) a6; a6=0; }
|
||||
{ __typeof__(0) a7; a7=0; }
|
||||
{ __typeof__(1) a8; a8=0; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user