[cfe-dev] Emit template backtrace in libtool diagnostics?

scott constable via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 26 11:56:33 PDT 2017


Hi All,

If I have a libtool processing code like this

template <typename T>
struct C {
  T *ptr; // error: cannot have a pointer to a reference
  bool func() { } // error: must return a value
};

C<int &>;

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.

How can this be done? I'm using the DiagnosticBuilder API, but it doesn't
provide any special functionality for dealing with templates.

Thanks in advance,

Scott Constable
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170726/a81640ab/attachment.html>


More information about the cfe-dev mailing list