<div dir="ltr">FYI, this fixes a diagnostic regression from 3.5 to 3.6 and should be merged to the 3.6 branch. The regression manifests as either a failed assertion or at least one missing error message.<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 4:04 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rikka<br>
Date: Tue Jan 20 18:04:19 2015<br>
New Revision: 226624<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226624&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=226624&view=rev</a><br>
Log:<br>
Correct all typos in the initialization arguments, even if one could not<br>
be corrected.<br>
<br>
This fixes PR22250, which exposed the bug where if there's more than one<br>
TypoExpr in the arguments, once one failed to be corrected none of the<br>
TypoExprs after it would be handled at all thanks to an early return.<br>
<br>
Modified:<br>
cfe/trunk/lib/Sema/SemaDecl.cpp<br>
cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=226624&r1=226623&r2=226624&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=226624&r1=226623&r2=226624&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Jan 20 18:04:19 2015<br>
@@ -8841,11 +8841,12 @@ void Sema::AddInitializerToDecl(Decl *Re<br>
});<br>
if (Res.isInvalid()) {<br>
VDecl->setInvalidDecl();<br>
- return;<br>
- }<br>
- if (Res.get() != Args[Idx])<br>
+ } else if (Res.get() != Args[Idx]) {<br>
Args[Idx] = Res.get();<br>
+ }<br>
}<br>
+ if (VDecl->isInvalidDecl())<br>
+ return;<br>
<br>
InitializationSequence InitSeq(*this, Entity, Kind, Args);<br>
ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT);<br>
<br>
Modified: cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp?rev=226624&r1=226623&r2=226624&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp?rev=226624&r1=226623&r2=226624&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp Tue Jan 20 18:04:19 2015<br>
@@ -167,3 +167,11 @@ void MovePointer(Pointer &Click, int x,<br>
click.set_xpos(x); // expected-error {{use of undeclared identifier 'click'; did you mean 'Click'?}}<br>
click.set_ypos(x); // expected-error {{use of undeclared identifier 'click'; did you mean 'Click'?}}<br>
}<br>
+<br>
+namespace PR22250 {<br>
+// expected-error@+4 {{use of undeclared identifier 'size_t'; did you mean 'sizeof'?}}<br>
+// expected-error-re@+3 {{use of undeclared identifier 'y'{{$}}}}<br>
+// expected-error-re@+2 {{use of undeclared identifier 'z'{{$}}}}<br>
+// expected-error@+1 {{expected ';' after top level declarator}}<br>
+int getenv_s(size_t *y, char(&z)) {}<br>
+}<br>
<br>
<br>
_______________________________________________<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" rel="noreferrer" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>