summaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-19 14:14:15 +0000
committerppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-19 14:14:15 +0000
commit005b8fe7ddc5de0e67eb48ca2b76058fa638ab28 (patch)
treeaa8358e5df2689d3a6cc449f8540ceb1d095a0c6 /gcc/c
parentc213f7ad0a99bf073634b5b970f7c9f0943f1fcf (diff)
downloadgcc-005b8fe7ddc5de0e67eb48ca2b76058fa638ab28.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214151 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 27f865eb29f..391cfeda95e 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -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
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index b1eac3462a5..3210f1ab4f7 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -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)
{