http://llvm.org/bugs/show_bug.cgi?id=15375
Bug ID: 15375
Summary: constexpr expression ends up as undefined symbol
Product: clang
Version: 3.2
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
Reduced testcase:
bug.cc:
#include <algorithm>
class Bug {
static constexpr unsigned max = 2;
public:
bool bug(int pos) { return pos < std::min(3u, max); }
};
int main() {
return Bug().bug(0);
}
> Users/sduvan/Code/llvm-build/Release+Asserts/bin/clang
> -mmacosx-version-min=10.6 -std=c++11 -stdlib=libc++ -nostdinc++
> -I/Users/sduvan/Code/libcxx/include -l c++ -L /Users/sduvan/Code/libcxx/lib
> -U__STRICT_ANSI__ -Wno-mismatched-tags -O3 -ggdb -DNG_LOGGING
> -Wl,-search_paths_first -headerpad_max_install_names
> CMakeFiles/bug.dir/bug.cc.o -o bug
Undefined symbols for architecture x86_64:
"__ZN3Bug3maxE", referenced from:
_main in bug.cc.o
Note that replacing std::min with std::max will make this problem go away.
--
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