[cfe-dev] [libcxx]: problem involving static const data members of class numeric_limits

ZhangXiongpang zhangxiongpang at gmail.com
Wed Nov 28 19:30:57 PST 2012

platform: linux, clang++3.2

#include <limits>

void fun(const bool *&*) {}  // report error when the parameter type is
reference type

int main() {

*error: undefined reference to

N3242 says:
If a static data member is of const literal type, its declaration in the
class definition can specify a brace-orequal-initializer in which every
initializer-clause that is an assignment-expression is a constant
The member shall still be defined in a namespace scope if it is odrused
(3.2) in the program and the namespace scope definition shall not contain an

I saw the static const data members (such as is_specialized, is_integer,
etc.) of class numeric_limits declared with a initializer, but not defined
out of class body. Is this libcxx's bug?

Zhang Xiongpang

View this message in context: http://clang-developers.42468.n3.nabble.com/libcxx-problem-involving-static-const-data-members-of-class-numeric-limits-tp4028564.html
Sent from the Clang Developers mailing list archive at Nabble.com.

More information about the cfe-dev mailing list