This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54483] New: undefined reference to static constexpr in .so
- From: "baliga at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 04 Sep 2012 18:30:43 +0000
- Subject: [Bug c++/54483] New: undefined reference to static constexpr in .so
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54483
Bug #: 54483
Summary: undefined reference to static constexpr in .so
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: baliga@gmail.com
In a.hh
---------
class A {
static constexpr float val = 0.08;
public:
bool foo(const float v);
};
In a.cc
--------
bool A::foo(const float v) {
return (v < -val);
}
Created a libfoo.so from the above code and linked this .so with another
executable using A::foo(const float) method.
Creating an executable result in "undefined reference to A::val"
If I replace val with -0.08 and change foo method with return (v < val), val is
getting inlined.