http://llvm.org/bugs/show_bug.cgi?id=16953
Bug ID: 16953
Summary: Support constexpr with builtins (Enhancement)
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Hi,
I have somme annoying issues with using builtins for generating compile-time
constants. It works beautiful with gcc but clang apparently doesnt have
"constexpr builtins". Most of them should easily be able to work at compile
time, amongst them: __builtin_ffs, __builtin_clz, __builtin_ctz,
__builtin_popcount, __builtin_bswap32, __builtin_bswap64
For testing, compile the following with -std=c++11:
inline constexpr int popCount(const unsigned long uVal)
{
return __builtin_popcountll(uVal);
}
int main()
{
return popCount(45);
]
--
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