aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-12-17 11:51:52 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-12-17 11:51:52 -0500
commit6ef15591e356a69b0a573c207d5a254124dbad0e (patch)
tree43e5b108e146dfd273927d08848340f3e7ec0f3f /gcc/cp
parent1ad2439beab4d872ca51fe46858a673e51fb8c0a (diff)
downloadgcc-6ef15591e356a69b0a573c207d5a254124dbad0e.zip
gcc-6ef15591e356a69b0a573c207d5a254124dbad0e.tar.gz
gcc-6ef15591e356a69b0a573c207d5a254124dbad0e.tar.bz2
re PR c++/67576 (expression of typeid( expression ) is evaluated twice)
PR c++/67576 PR c++/25466 * rtti.c (build_typeid): Use save_expr, not stabilize_reference. From-SVN: r231776
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/rtti.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a192f00..73906f3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-12-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/67576
+ PR c++/25466
+ * rtti.c (build_typeid): Use save_expr, not stabilize_reference.
+
2015-12-16 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/16333
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index b397b55..f42b1cb 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -332,7 +332,7 @@ build_typeid (tree exp, tsubst_flags_t complain)
/* So we need to look into the vtable of the type of exp.
Make sure it isn't a null lvalue. */
exp = cp_build_addr_expr (exp, complain);
- exp = stabilize_reference (exp);
+ exp = save_expr (exp);
cond = cp_convert (boolean_type_node, exp, complain);
exp = cp_build_indirect_ref (exp, RO_NULL, complain);
}