<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 --- - -Wunused-function complains (spammily) about static constexpr functions"
href="http://llvm.org/bugs/show_bug.cgi?id=19713">19713</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wunused-function complains (spammily) about static constexpr functions
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>arthur.j.odwyer@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>constexpr functions are inline by definition:
(ยง7.1.5/2): "constexpr functions and constexpr constructors are implicitly
inline (7.1.2)."
However, when you feed Clang 3.4 the following translation unit, you get
-Wunused-function errors:
cat >test.h <<EOF
static inline int isI() { return 1; }
static constexpr int isC() { return 1; }
static inline constexpr int isIandC() { return 1; }
EOF
cat >test.cc <<EOF
#include "test.h"
int main() {}
EOF
clang++ test.cc -std=c++11 -Wunused-function
In file included from test.cc:1:
./test.h:2:22: warning: unused function 'isC' [-Wunused-function]
static constexpr int isC() { return 1; }
^
1 warning generated.
The -Wunused-function diagnostic should be suppressed for "static constexpr
[inline]" functions the same way it's suppressed for "static inline" functions.
Otherwise, any C++11 project that includes third-party header files has to pass
-Wno-unused-function, and that's annoying.</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>