Thanks for the test case updates that helps me.<div><br></div><div><div>+        if (ReturnsVoid && !HasNoReturn && CD.diag_NeverFallThroughOrReturn) {</div><div>+          if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {</div>
<div>+            assert(CD.diag_NeverFallThroughOrReturn ==</div><div>+                   diag::warn_suggest_noreturn_function);</div><div><br></div><div><div>As a consequence, I don't really think we need the assertions here. The test cases would actually assert if an improper diagnostic went in, I think my initial confusion was merely due to a lack of test cases for me to look at and understand how this worked. =D</div>
</div><div><br></div><div>+            S.Diag(Compound->getLBracLoc(),</div><div>+                   CD.diag_NeverFallThroughOrReturn) << FD->getNameAsString();</div><div>+          } else {</div><div>+            assert(CD.diag_NeverFallThroughOrReturn ==</div>
<div>+                   diag::warn_suggest_noreturn_block);</div><div><br></div><div>Same here. Essentially, it undermines the abstraction I think this code wants to derive from the CD.diag_... field.</div><div><br></div>
<div>+            S.Diag(Compound->getLBracLoc(),</div><div>+                   CD.diag_NeverFallThroughOrReturn);</div><div>+          }</div><div>+        }</div></div><div><br></div><div><br></div><div>Regarding just using "<< FD;" above:</div>
<div><br></div><div><div class="gmail_quote">On Mon, Aug 29, 2011 at 3:49 PM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":bf1">It doesn't, not exactly sure why. I'm using getNameAsString() now.</div></blockquote><div><br></div><div>I'm confused as well. It should work! ;]</div><div><br></div><div>I patched this in and dug into it. It seems the operator overload just didn't work for pointers to const objects. I've fixed that, and updated the Diagnostic code to use pointers to const objects as well (and be cleaner code).</div>
<div><br></div><div>I've committed your patch with the above changes (and some style tweaks) along with the bug fixes to the diagnostic builder code in r138854. Thanks!</div></div></div>