diff options
author | torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-21 22:29:31 +0000 |
---|---|---|
committer | torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-21 22:29:31 +0000 |
commit | 2d3bf658915afc664d9c1f7ef06000a945eeb2bf (patch) | |
tree | 34a48a93c32d86a3671f6aa53cd162dbd27c0c21 /gcc/trans-mem.c | |
parent | e1beed70f0a662b3c5162bb34b7f3f032f339f81 (diff) | |
download | gcc-2d3bf658915afc664d9c1f7ef06000a945eeb2bf.tar.gz |
PR47747: Fix error messages for calls to unsafe virtual functions.
gcc/
* trans-mem.c (diagnose_tm_1): Print an expression instead of a
declaration in error messages for indirect calls.
testsuite/
g++.dg/tm/pr47747.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181602 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/trans-mem.c')
-rw-r--r-- | gcc/trans-mem.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 3c0bd600943..347183b1568 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -659,13 +659,27 @@ diagnose_tm_1 (gimple_stmt_iterator *gsi, bool *handled_ops_p, if (TREE_CODE (fn) == ADDR_EXPR) fn = TREE_OPERAND (fn, 0); if (d->block_flags & DIAG_TM_SAFE) - error_at (gimple_location (stmt), - "unsafe function call %qD within " - "atomic transaction", fn); + { + if (direct_call_p) + error_at (gimple_location (stmt), + "unsafe function call %qD within " + "atomic transaction", fn); + else + error_at (gimple_location (stmt), + "unsafe function call %qE within " + "atomic transaction", fn); + } else - error_at (gimple_location (stmt), - "unsafe function call %qD within " - "%<transaction_safe%> function", fn); + { + if (direct_call_p) + error_at (gimple_location (stmt), + "unsafe function call %qD within " + "%<transaction_safe%> function", fn); + else + error_at (gimple_location (stmt), + "unsafe function call %qE within " + "%<transaction_safe%> function", fn); + } } } } |