https://bugs.llvm.org/show_bug.cgi?id=33098
Bug ID: 33098
Summary: Undefined symbol link-time error with std::make_shared
and scoped constexpr value
Product: clang
Version: 3.8
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: marcosa...@gmail.com
CC: llvm-bugs@lists.llvm.org
Created attachment 18470
--> https://bugs.llvm.org/attachment.cgi?id=18470&action=edit
Failing source code
Source code attached fails at the linking stage.
>From the output, I can see it is calling make_shared using a reference, not a
constant. Of course, the constexpr is taken out at compile time, and so fails
with undefined reference.
marco@Marco-Laptop-PC:/mnt/c/Shared/Dev/Projects/clangbug$ clang++-5.0
--version
clang version 5.0.0-svn303316-1~exp1 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
marco@Marco-Laptop-PC:/mnt/c/Shared/Dev/Projects/clangbug$ clang++-5.0
-std=c++14 main.cpp -o main
/tmp/main-1722a6.o: In function `main':
main.cpp:(.text+0x17): undefined reference to `test::sz'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
marco@Marco-Laptop-PC:/mnt/c/Shared/Dev/Projects/clangbug$
However, using -std=c++1z, the code compiles fine. I have tested -std=c++14
with clang 3.8, 4.0 and 5.0 (all fail), only tested -std=c++1z with 5.0
(works).
It could also be a GCC bug, which I have used to compare against. Using
-std=c++14 works under GCC. (Sorry if it is!)
If it matters, I am running Ubuntu 16.04 under the Windows subsystem for Linux.
Thanks, Marco.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs