[LLVMbugs] [Bug 18781] New: linking fails for constexpr static const char* member

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 9 02:42:12 PST 2014


            Bug ID: 18781
           Summary: linking fails for constexpr static const char* member
           Product: clang
           Version: 3.4
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: akim.demaille at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


$ cat baz.cc
#include <iostream>
struct foo
  constexpr static const char* me = "foo";

int main ()
  foo f;
  std::cerr << f.me << std::endl;

$ clang++-mp-3.5 -std=c++11 baz.cc
Undefined symbols for architecture x86_64:
  "foo::me", referenced from:
      _main in baz-ae302f.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ g++-mp-4.9 -std=c++11 baz.cc
$ ./a.out

Might be related to #18696, I don't know.

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/20140209/775f6565/attachment.html>

More information about the llvm-bugs mailing list