<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On Aug 6, 2010, at 4:41 PM, Ted Kremenek wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">On Aug 6, 2010, at 3:13 AM, Douglas Gregor <<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>> wrote:</span></div><div><br></div><blockquote type="cite"><blockquote type="cite"><span>+          assert(<a href="http://Tok.is/" x-apple-data-detectors="true"></a><a href="http://Tok.is/">Tok.is</a>(tok::cxx_defaultarg_end) &&</span><br></blockquote><blockquote type="cite"><span>+                 "We didn't parse the whole default arg!");</span><br></blockquote><blockquote type="cite"><span>+          ConsumeToken(); // Consume tok::cxx_defaultarg_end.</span><br></blockquote><span></span><br><span>How about we SkipUntil the tok::cxx_defaultarg_end, and give an error if it's not the next token? That way, if expression parsing doesn't use up all of the tokens, we'll give a reasonable diagnostic rather than asserting.</span></blockquote><br><div></div><div>+1.  Assertions for cases that might trigger on invalid code are highly undesirable.  I'm not certain if that is the case here, but it looks like it to me.</div></div></blockquote><br></div><div>It won't be triggered on invalid code, it's supposed to be triggered when clang left tokens while no errors occured.</div><br></body></html>