aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-01-28 12:06:47 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-01-28 12:06:47 -0500
commit1377eb9a039c645be59c3ac3881b97a494d3db53 (patch)
tree540d4439ccafd0208c867e0584448441f34f76f2 /gcc
parent2e5e7103a39315664f9a625bea42981f5251c27e (diff)
downloadgcc-1377eb9a039c645be59c3ac3881b97a494d3db53.zip
gcc-1377eb9a039c645be59c3ac3881b97a494d3db53.tar.gz
gcc-1377eb9a039c645be59c3ac3881b97a494d3db53.tar.bz2
* decl.c (duplicate_decls): Tweak.
From-SVN: r207198
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/decl.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3da4ab4..c5e24d9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,7 @@
2014-01-28 Jason Merrill <jason@redhat.com>
+ * decl.c (duplicate_decls): Tweak.
+
PR c++/53756
* mangle.c (write_unqualified_name): Handle operator auto.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c93c783..aca96fc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1923,13 +1923,13 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (TREE_CODE (newdecl) == FUNCTION_DECL)
maybe_instantiate_noexcept (olddecl);
- /* Merge the data types specified in the two decls. */
- newtype = merge_types (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
-
/* For typedefs use the old type, as the new type's DECL_NAME points
at newdecl, which will be ggc_freed. */
if (TREE_CODE (newdecl) == TYPE_DECL)
newtype = oldtype;
+ else
+ /* Merge the data types specified in the two decls. */
+ newtype = merge_types (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
if (VAR_P (newdecl))
{