aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-10-02 18:01:50 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-10-02 18:01:50 +0000
commit1c7485afda66c17e00d3dcdce2ef9bf9106d3cda (patch)
treed5d60aff6ad3a5769953eceda32f81ad7a05817c /gcc/c
parent12651878c680a8568e4d6c03b72d05728f0637fc (diff)
downloadgcc-1c7485afda66c17e00d3dcdce2ef9bf9106d3cda.zip
gcc-1c7485afda66c17e00d3dcdce2ef9bf9106d3cda.tar.gz
gcc-1c7485afda66c17e00d3dcdce2ef9bf9106d3cda.tar.bz2
re PR c/67730 (No warning when returning NULL in void function)
PR c/67730 * c-typeck.c (convert_for_assignment): Use the expansion point location throughout. * gcc.dg/pr67730-1.c: New test. * gcc.dg/pr67730-2.c: New test. * gcc.dg/pr67730.h: New test. From-SVN: r228408
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 7c0051f..c6eab4e 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,11 @@
2015-10-02 Marek Polacek <polacek@redhat.com>
+ PR c/67730
+ * c-typeck.c (convert_for_assignment): Use the expansion point
+ location throughout.
+
+2015-10-02 Marek Polacek <polacek@redhat.com>
+
PR c/64249
* c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter
and pass it down to c_parser_if_statement.
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 11e487c..ad02d6c 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -5718,6 +5718,10 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
tree rname = NULL_TREE;
bool objc_ok = false;
+ /* Use the expansion point location to handle cases such as user's
+ function returning a wrong-type macro defined in a system header. */
+ location = expansion_point_location_if_in_system_header (location);
+
if (errtype == ic_argpass)
{
tree selector;