<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Dec 3, 2013, at 9:35 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>On Dec 3, 2013, at 9:10 , Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:<br><br><blockquote type="cite">Author: fjahanian<br>Date: Tue Dec 3 11:10:08 2013<br>New Revision: 196296<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=196296&view=rev">http://llvm.org/viewvc/llvm-project?rev=196296&view=rev</a><br>Log:<br>Issue diagnostic when constructor or destructor<br>return void expression. // <a href="rdar://15366494">rdar://15366494</a><br>pr17759.<br><br>Modified:<br> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br> cfe/trunk/lib/Sema/SemaStmt.cpp<br> cfe/trunk/test/SemaCXX/return.cpp<br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=196296&r1=196295&r2=196296&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=196296&r1=196295&r2=196296&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Dec 3 11:10:08 2013<br>@@ -6426,6 +6426,8 @@ def ext_return_has_void_expr : Extension<br>def err_return_init_list : Error<<br> "%select{void function|void method|constructor|destructor}1 %0 "<br> "must not return a value">;<br>+def err_ctor_dtor_returns_void : Error<<br>+ "%select{constructor|destructor}1 %0 must not return void expression">;<br></blockquote><br>Nitpicking: this wording makes it sound like it must return some other kind of expression. How about "...may not return an expression"? Or, if we care about being technically correct, "using an expression with 'return' is not allowed in a %select{constructor|destructor}0”.<br></blockquote><div><br></div>There are situations where we issue <font face="Menlo"><span style="font-size: 11px;">ExtWarn when a non-void expression is returned. So, I wanted to say ‘void expressions’.</span></font></div><div><span style="font-family: Menlo; font-size: 11px;">(see </span><span style="font-family: Menlo; font-size: 11px;">ext_return_has_expr).</span></div><div><span style="font-family: Menlo; font-size: 11px;">- Fariborz</span></div><div><span style="font-family: Menlo; font-size: 11px;"><br></span></div><div><blockquote type="cite"><br>Jordan</blockquote></div><br></body></html>