<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 18, 2008, at 8:13 AM, Douglas Gregor wrote:</div><blockquote type="cite"><div><blockquote type="cite">+  DiagnosticInfo &operator<<(const SourceRange &R) {<br></blockquote><blockquote type="cite">+    assert((unsigned)DiagObj->NumDiagArgs <<br></blockquote><blockquote type="cite">+           sizeof(DiagObj->DiagRanges)/sizeof(DiagObj- <br></blockquote><blockquote type="cite"><blockquote type="cite">DiagRanges[0]) &&<br></blockquote></blockquote><blockquote type="cite">+           "Too many arguments to diagnostic!");<br></blockquote><blockquote type="cite">+    DiagObj->DiagRanges[DiagObj->NumDiagRanges++] = &R;<br></blockquote><blockquote type="cite">+    return *this;<br></blockquote><blockquote type="cite">+  }<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">};<br></blockquote><br>These operator<<'s should be free functions, because we will certainly  <br>have other operator<<'s for DiagnosticInfo elsewhere in the compiler  <br>that must be free functions, e.g.,<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>DiagnosticInfo& operator<<(DiagnosticInfo& DI, QualType Ty); // in  <br>clang/AST/Type.h<br><br>and we don't want non-member and member operator<<'s overloaded  <br>because the available conversions on the first argument differ, and  <br>that causes overloading weirdness.</div></blockquote><br></div><div>Yes, I totally agree.  Okay, I'm to the point where I want to do this.  However, this is not my day.  Please take a look at this patch:</div><div><br></div><div></div></body></html>