]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/ChangeLog
PR c++/89001 - mangling of reference temporaries
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2019 21:23:33 +0000 (21:23 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2019 21:23:33 +0000 (21:23 +0000)
commit8c89c5fc26e8678cdd2b916fa36a643bd8f34e7c
tree67889379df002d31eddb52c1ab9859fbe535a995
parent530b8be5000dc1b7fcd940d8d8a0dae43be7df36
PR c++/89001 - mangling of reference temporaries

It used to be the case that the mangled name of a reference temporary didn't
need to be standardized, because all access would be through the reference.
But now constant expressions can look through references and so different
translation units need to agree on the address of a temporary in the
initializer of a reference with vague linkage.

* cp-tree.h (struct saved_scope): Add ref_temp_count.
(current_ref_temp_count): New macro.
* mangle.c (mangle_ref_init_variable): Use it.
* typeck2.c (store_init_value): Clear it.
* call.c (make_temporary_var_for_ref_to_temp): Copy public and
comdat.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268252 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/mangle.c
gcc/cp/typeck2.c
gcc/testsuite/g++.dg/abi/ref-temp1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/decomp34.C