<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 3:30 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=dblaikie@gmail.com&cc=&bcc=&su=&body=','_blank');return false;" class="cremed">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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Nov 5, 2014 at 1:06 PM, Kaelyn Takata <span dir="ltr"><<a href="mailto:rikka@google.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=rikka@google.com&cc=&bcc=&su=&body=','_blank');return false;" class="cremed">rikka@google.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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Nov 4, 2014 at 4:36 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=dblaikie@gmail.com&cc=&bcc=&su=&body=','_blank');return false;" class="cremed">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></span><div>I've added comments for both boolean values in the call to SemaRef.BuildDeclarationNameExpr from attemptRecovery.</div><span><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></span><div>The flag is needed to get a valid DeclRefExpr during error recovery even when the Decl isn't marked as valid.</div></div></div></div></blockquote><div><br></div></span><div>Why does this need to be a flag? (what bad things happen if we always accept invalid decls?)</div></div></div></div></blockquote><div><br></div><div>Setting the flag to always be true breaks tests in CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp, SemaCXX/dependent-auto.cpp, SemaCXX/lambda-expressions.cpp, and SemaObjCXX/<a href="http://instantiate-stmt.mm">instantiate-stmt.mm</a>. It also causes the assertion failure "cannot request the size of an undeduced or dependent auto type" in SemaCXX/lambda-expressions.cpp.</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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> 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><span><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>On Wed, Oct 29, 2014 at 12:49 PM, Kaelyn Takata <span dir="ltr"><<a href="mailto:rikka@google.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=rikka@google.com&cc=&bcc=&su=&body=','_blank');return false;" class="cremed">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>---<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" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=cfe-commits@cs.uiuc.edu&cc=&bcc=&su=&body=','_blank');return false;" class="cremed">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></span></div><br></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>