This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR c++/26693

Dodji Seketeli wrote:
2/ When tsubst() encounters a typedef variant type, it tries to "reuse" its specialization, instead of tsubst-ing its main variant type. This works great. But when the main variant type is a TYPENAME_TYPE, I think we need to make sure the main variant type can be properly tsubst-ed before attempting to reuse the specialization of the typedef variant type.

This sounds wrong to me: if tsubsting the TYPENAME_TYPE was going to be a problem, we ought to get that error when we instantiate the class of which the typedef is a member.

+	  if (DECL_IS_BUILTIN (x)
+	      || (TREE_TYPE (x) != error_mark_node
+		  && TYPE_NAME (type) != x
+		  /* We don't want to copy the type when all we're
+		     doing is making a TYPE_DECL for the purposes of
+		     inlining.  */
+		  && (!TYPE_NAME (type)
+		      || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x))))
+	    clone_underlying_type (x);

This is wrong: if DECL_IS_BUILTIN (x) we don't want to create a typedef variant, we just want to set TYPE_NAME (type) to x.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]