[llvm-bugs] [Bug 46663] New: undefined symbol when a static constexpr field is defined in the class body
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jul 9 13:48:55 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46663
Bug ID: 46663
Summary: undefined symbol when a static constexpr field is
defined in the class body
Product: clang
Version: trunk
Hardware: PC
OS: FreeBSD
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: yuri at tsoft.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Created attachment 23711
--> https://bugs.llvm.org/attachment.cgi?id=23711&action=edit
bug.cpp
Compiling the attached code fails:
> $ c++ -o bug bug.cpp
> ld: error: undefined symbol: C::c
> >>> referenced by bug.cpp
> >>> /tmp/bug-9480f8.o:(C::s())
> c++: error: linker command failed with exit code 1 (use -v to see invocation)
The field "static constexpr float c = 1;" should always lead to symbol "c"
being defined.
Replacing the return type with "float" and returning just "c" makes the problem
go away.
Observed for clang-9.0.1 and clang-11.0.d20200519
OS: FreeBSD 12.1
--
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/20200709/1f03b832/attachment.html>
More information about the llvm-bugs
mailing list