[LLVMbugs] [Bug 15375] New: constexpr expression ends up as undefined symbol

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 27 04:35:40 PST 2013


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: unassignedclangbugs at nondot.org
          Reporter: duvan.llvm at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130227/8c95fe67/attachment.html>


More information about the llvm-bugs mailing list