<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add clang_isNoReturnFunction to determine if a function is __attribute__((noreturn))"
href="https://bugs.llvm.org/show_bug.cgi?id=32691">32691</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Add clang_isNoReturnFunction to determine if a function is __attribute__((noreturn))
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>libclang
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>harlan@harlanhaskins.com
</td>
</tr>
<tr>
<th>CC</th>
<td>klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Currently, libclang doesn't have a wrapper to determine if a given CXCursor is
a function decorated with __attribute__((noreturn)).
It can be implemented as such:
int clang_isNoReturn(CXCursor cursor) {
assert(cursor.kind == CXCursor_FunctionDecl);
auto fn = static_cast<const clang::FunctionDecl *>(cursor.data[0]);
if (!fn) return 0;
return fn->isNoReturn() ? 1 : 0;
}
If this is something that's wanted or useful, I'd be happy to submit a patch.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>