On 05/25/2011 02:15 PM, Nathan Froyd wrote:
The patch below implements just such an idea.  The only twist is that
the `explain' parameter is actually a `location_t *' so that when we
provide explanations that aren't produced via tf_warning_or_error
blocks, the explanations are attached to the template itself rather than
the call, as would be done with input_location.  Requests for
non-explanation are accomplished with a NULL argument.

I'm not totally attached to this; it's almost too cute, and since
tf_warning_or_error messsages tend to be attached to the call anyway,
it's arguably inconsistent.

Yes, I think let's drop this bit and just use the call location. Ideally, for unification failures we'd give the source location of the problematic argument (which we don't always have because it might be a plain DECL) and for substitution failures we'd give the source location of the expression that substitution failed on (for which we could adjust input_location in tsubst_*).

I didn't see what you intended by "reconstructing" the arguments, so I
implemented the more straightforward saving.

I was thinking that we could try to add the candidate again, but this is fine.

Jason

Reply via email to