<div dir="ltr">Hi All,<div><br></div><div>If I have a libtool processing code like this</div><div><br></div><div>template <typename T></div><div>struct C {</div><div>  T *ptr; // error: cannot have a pointer to a reference</div><div>  bool func() { } // error: must return a value</div><div>};</div><div><br></div><div>C<int &>;</div><div><br></div><div>there are two kinds of errors: one which results from a dependent template type substitution during template specialization, and one which is independent of the template context. Ideally, the tool's diagnostics would emit a template backtrace in the former case, but not the latter.</div><div><br></div><div>How can this be done? I'm using the DiagnosticBuilder API, but it doesn't provide any special functionality for dealing with templates.</div><div><br></div><div>Thanks in advance,</div><div><br></div><div>Scott Constable</div></div>