http://llvm.org/bugs/show_bug.cgi?id=19713
Bug ID: 19713
Summary: -Wunused-function complains (spammily) about static
constexpr functions
Product: clang
Version: 3.4
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs