[Bug c++/98105] constexpr and unnamed namespace yields relocation R_X86_64_PC32 against undefined symbol ... can not be used when making a shared object; recompile with -fPIC

2023-06-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98105 --- Comment #3 from Andrew Pinski --- Reduced: ``` void f(const int&); namespace { struct myFactory { static constexpr int s_sList = 1; }; } //constexpr int myFactory::s_sList; void sdi_register_model() { f(myFactory::s_sList); }

[Bug c++/98105] constexpr and unnamed namespace yields relocation R_X86_64_PC32 against undefined symbol ... can not be used when making a shared object; recompile with -fPIC

2020-12-03 Thread peter_foelsche at mentor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98105 --- Comment #2 from Peter Foelsche --- sorry -- adding a definition outside of class for the variable solves the problem!

[Bug c++/98105] constexpr and unnamed namespace yields relocation R_X86_64_PC32 against undefined symbol ... can not be used when making a shared object; recompile with -fPIC

2020-12-02 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98105 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |NEW Keywords|