Commit b89cc12b by Jason Merrill Committed by Jason Merrill

re PR c++/54652 (ICE with -g)

	PR c++/54652
	* decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.

From-SVN: r207169
parent 9e73c3f3
2014-01-27 Jason Merrill <jason@redhat.com>
PR c++/54652
* decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
PR c++/58504
* pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
types.
......
......@@ -1926,9 +1926,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
/* Merge the data types specified in the two decls. */
newtype = merge_types (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
/* If merge_types produces a non-typedef type, just use the old type. */
if (TREE_CODE (newdecl) == TYPE_DECL
&& newtype == DECL_ORIGINAL_TYPE (newdecl))
/* 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;
if (VAR_P (newdecl))
......
// PR c++/54652
typedef unsigned L __attribute__ ((aligned));
typedef unsigned L __attribute__ ((aligned));
L l;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment