<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 4, 2016 at 11:37 AM, Piotr Dziwinski <span dir="ltr"><<a href="mailto:piotrdz@gmail.com" target="_blank">piotrdz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span>Yes, you can add many fix it hints for a given diagnostic. For
example:<br>
<br>
auto Diagnostic = </span><span>diag(Loc, "</span>diagnostic")<span>;<br>
Diagnostic.</span><span>AddFixItHint(<span>FixItHint::CreateInsertion</span>(/*...*/<span></span>));<br>
</span><span><span> Diagnostic.</span><span>AddFixItHint(<span>FixItHint::CreateRemoval</span>(<span></span>/*...*/));<br>
<br>
This can also be achieved through overloaded operator<<
which is just a wrapper for the same function calls.<br></span></span></div></blockquote><div><br></div><div>This works during the same call to "check" However if I stash the pointer to the "Diagnostic" variable (e.g., in a map) and lookup and use the reference later I'm getting a core dump. I'm guessing that is because the object created by "diag()" call is not intended to be stashed.</div><div><br></div><div>Is there a way to get a clang::DiagnosticBuilder object that can be safely stashed?</div><div><br></div><div>What I am doing is first removing somthing like</div><div><br></div><div>using namespace sl;</div><div><br></div><div>from the code</div><div><br></div><div>then adding qualifiers for each use, e.g., "foo" becomes "sl::foo"</div><div><br></div><div>so the "add qualifier" part gets identified in later calls to "check"</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><span><span>
</span><br>
Best regards,<br>
Piotr Dziwinski<br>
</span><div><div class="h5"><br>
</div></div></div>
</blockquote></div><br>Thanks!<br clear="all"><div>Tim</div>-- <br><div class="gmail_signature">Tim Halloran<br>SureLogic, Inc.<br>5808 Forbes Avenue, Pittsburgh PA 15217-1602<br>(412) 722-3338</div>
</div></div>