diff options
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r-- | gcc/cp/typeck.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 729e22eadc5..7b28a9a5869 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -8309,9 +8309,12 @@ maybe_warn_about_returning_address_of_local (tree retval) if (TREE_CODE (valtype) == REFERENCE_TYPE) warning (OPT_Wreturn_local_addr, "reference to local variable %q+D returned", whats_returned); - else - warning (OPT_Wreturn_local_addr, "address of local variable %q+D returned", + else if (TREE_CODE (whats_returned) == LABEL_DECL) + warning (OPT_Wreturn_local_addr, "address of label %q+D returned", whats_returned); + else + warning (OPT_Wreturn_local_addr, "address of local variable %q+D " + "returned", whats_returned); return; } } |