<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sun, Jan 15, 2012 at 10:08 AM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>A nice idea, but the implementation is not really correct.  Please</div>
take a look at Parser::ParseExternalDeclaration in<br>
llvm/tools/clan/lib/Parse/Parser.cpp:<br>
err_expected_external_declaration is emitted in three cases, and only<br>
one is the case of extra brace.  For example,<br>
$ cat > a.c<br>
+<br>
$ clang a.c<br>
a.c:1:1: error: expected external declaration<br>
+<br>
^<br>
1 error generated.<br>
<br>
So I think you should add other (new) error message and change the<br>
relevant case in Parser.cpp.</blockquote></div></div></blockquote><div><br></div><div>Taking your advice, I made a new error (err_extraneous_closing_brace) in include/clang/Basic/DiagnosticParseKinds.td, switched the first case in lib/Parse/Parser.cpp to using the new error, and updated the test cases (again, all tests pass).</div>
<div><br></div><div>- Jason "s1n" Switzer<br></div></div>