diff options
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 45efc1c..cac842f 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3480,8 +3480,14 @@ maybe_warn_for_bound (int opt, location_t loc, tree exp, tree func, if (warned) { if (pad && pad->dst.ref) - inform (DECL_SOURCE_LOCATION (pad->dst.ref), - "destination object declared here"); + { + if (DECL_P (pad->dst.ref)) + inform (DECL_SOURCE_LOCATION (pad->dst.ref), + "destination object declared here"); + else if (EXPR_HAS_LOCATION (pad->dst.ref)) + inform (EXPR_LOCATION (pad->dst.ref), + "destination object allocated here"); + } TREE_NO_WARNING (exp) = true; } |