<div dir="ltr">This example seems to work:<br><br><div>int f() {</div><div>  auto F = []() __attribute__((noreturn)) { abort(); };</div><div>  F();</div><div>}<br><br>Though in LLVM, the LLVM_ATTRIBUTE_NORETURN macro rather than __attribute__((noreturn)). (it's possible that using an attribute in this location isn't uniformly supported by all compilers LLVM supports (at least those that support the attribute in other contexts (the macro expands to nothing on platforms that don't support the attribute anywhere)) in which case maybe just pulling the function out into a named file-local-static function would be fine, and that can be attributed)</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jun 12, 2017 at 12:11 PM Galina Kistanova <<a href="mailto:gkistanova@gmail.com">gkistanova@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Because ReportError is a lambda, and I do not think one could declare operator() of a lambda as noreturn on any standard way within c++11.<br>What am I missing?<br><br></div>Thanks<br><br></div></div><div dir="ltr">Galina</div><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 9:53 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Why can't ReportError be noreturn?</div><div class="m_-3052901090252233458HOEnZb"><div class="m_-3052901090252233458h5"><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 10, 2017 at 12:50 AM Galina Kistanova via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gkistanova<br>
Date: Sat Jun 10 02:50:14 2017<br>
New Revision: 305143<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=305143&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=305143&view=rev</a><br>
Log:<br>
Added llvm_unreachable as ReportError cannot be specified as noreturn.<br>
<br>
Modified:<br>
    llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp?rev=305143&r1=305142&r2=305143&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp?rev=305143&r1=305142&r2=305143&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Sat Jun 10 02:50:14 2017<br>
@@ -585,6 +585,7 @@ void DWARFDebugFrame::parse(DataExtracto<br>
           switch (AugmentationString[i]) {<br>
             default:<br>
               ReportError("Unknown augmentation character in entry at %lx");<br>
+              llvm_unreachable("ReportError should not return.");<br>
             case 'L':<br>
               LSDAPointerEncoding = Data.getU8(&Offset);<br>
               break;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div></div></blockquote></div>