<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 9:13 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 29/01/2014 16:47, David Blaikie wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
<br>
On Wed, Jan 29, 2014 at 12:49 AM, Manuel Klimek <<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a> <mailto:<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>>> wrote:<br>

<br>
    Author: klimek<br>
    Date: Wed Jan 29 02:49:02 2014<br>
    New Revision: 200381<br>
<br>
    URL: <a href="http://llvm.org/viewvc/llvm-project?rev=200381&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=200381&view=rev</a><br>
    Log:<br>
    Fix crash on unmatched #endif's.<br>
<br>
    The following snippet would crash:<br>
      #endif<br>
      #if A<br>
<br>
<br>
Any reason this wasn't contributed as a test case?<br>
<br>
<br></div><div class="im">
    ==============================<u></u>==============================<u></u>==================<br>
    --- cfe/trunk/unittests/Format/<u></u>FormatTest.cpp (original)<br>
    +++ cfe/trunk/unittests/Format/<u></u>FormatTest.cpp Wed Jan 29 02:49:02 2014<br>
    @@ -2427,6 +2427,11 @@ TEST_F(FormatTest, LayoutStatementsAroun<br>
                    "#endif");<br>
     }<br>
<br>
    +TEST_F(FormatTest, GraciouslyHandleIncorrectPrepr<u></u>ocessorConditions) {<br>
    +  verifyFormat("#endif\n"<br>
    +               "#if B");<br>
    +}<br>
    +<br>
<br>
</div></blockquote>
<br>
Like this?</blockquote><div><br></div><div>Yep, exactly that. Clearly too early in the morning - thanks guys.<br><br>(if I had to guess I'd say it was a combination of "oh, someone mentioned a test case in the commit message, this is often associated with that test case not actually being committed" and my not noticing a unittest change in my simple brain-fuzzy-matcher that searches for the more common lit tests) </div>
</div></div></div>