<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 4, 2014 at 4:36 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">It's helpful to either use an enum (which always seems a bit silly) or a comment (more realistic, especially since you only have to comment that single caller in attemptRecovery) to describe what the boolean value is for ("/*AcceptInvalidDecl*/ true").<br></div></blockquote><div><br></div><div>I've added comments for both boolean values in the call to SemaRef.BuildDeclarationNameExpr from attemptRecovery.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br>What's this flag needed/used for?</div></blockquote><div><br></div><div>The flag is needed to get a valid DeclRefExpr during error recovery even when the Decl isn't marked as valid. For example, with the full patch set, not having the flag causes the last error of test/SemaCXX/conversion-function.cpp (at line 419) to fail to be typo-corrected. With the flag or without this patchset:</div><div><br></div><div><div><font face="monospace">~/llvm/tools/clang/test/SemaCXX/conversion-function.cpp:419:18: error: no member named 'e' in 'PR18234::A'; did you mean simply 'e'?</font></div><div><font face="monospace">  bool k1 = e == A::e; // expected-error {{no member named 'e'}}</font></div><div><font face="monospace">                 ^~~~</font></div><div><font face="monospace">                 e</font></div><div><font face="monospace">~/llvm/tools/clang/test/SemaCXX/conversion-function.cpp:418:8: note: 'e' declared here</font></div><div><font face="monospace">  A::E e = a; // expected-note {{here}}</font></div><div><font face="monospace">       ^</font></div><div><font face="monospace">4 warnings and 26 errors generated.</font></div></div><div><br></div><div>With this patchset but without this flag:</div><div><br></div><div><div><font face="monospace">~/llvm/tools/clang/test/SemaCXX/conversion-function.cpp:419:21: error: no member named 'e' in 'PR18234::A'</font></div><div><font face="monospace">  bool k1 = e == A::e; // expected-error {{no member named 'e'}}</font></div><div><font face="monospace">                 ~~~^</font></div><div><font face="monospace">4 warnings and 26 errors generated.</font></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Oct 29, 2014 at 12:49 PM, Kaelyn Takata <span dir="ltr"><<a href="mailto:rikka@google.com" target="_blank">rikka@google.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">---<br>
 include/clang/Sema/Sema.h |  6 ++++--<br>
 lib/Sema/SemaExpr.cpp     | 15 ++++++++-------<br>
 lib/Sema/SemaExprCXX.cpp  |  2 +-<br>
 3 files changed, 13 insertions(+), 10 deletions(-)<br>
<br>
<br></div></div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>