This is the mail archive of the gcc-patches@gcc.gnu.org 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 v3 of 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)


On 01/09/2018 06:53 AM, David Malcolm wrote:
+    case NON_LVALUE_EXPR:
+    case VIEW_CONVERT_EXPR:
+	{
+	  /* Handle location wrappers by substituting the wrapped node
+	     first,*then*  reusing the resulting type.  Doing the type
+	     first ensures that we handle template parameters and
+	     parameter pack expansions.  */
+	  gcc_assert (location_wrapper_p (t));
+	  tree op0 = tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl);
+	  return build1 (code, TREE_TYPE (op0), op0);
+	}

Doesn't this lose the location information?

+      /* We should only see these for location wrapper nodes, or for
+	 VIEW_CONVERT_EXPRs within instantiate_non_dependent_expr (when
+	 args is NULL_TREE).  */
+      gcc_assert (location_wrapper_p (t)
+		  || (TREE_CODE (t) == VIEW_CONVERT_EXPR
+		      && args == NULL_TREE));

Let's just say "|| args == NULL_TREE", it might be possible to see a NON_LVALUE_EXPR in that context as well.

Jason


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