public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54483] New: undefined reference to static constexpr in .so
@ 2012-09-04 18:31 baliga at gmail dot com
  2012-09-05  7:50 ` [Bug c++/54483] " jakub at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: baliga at gmail dot com @ 2012-09-04 18:31 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-18  5:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04 18:31 [Bug c++/54483] New: undefined reference to static constexpr in .so baliga at gmail dot com
2012-09-05  7:50 ` [Bug c++/54483] " jakub at gcc dot gnu.org
2012-09-05  9:21 ` rguenth at gcc dot gnu.org
2012-09-05 11:12 ` daniel.kruegler at googlemail dot com
2012-09-05 11:21 ` paolo.carlini at oracle dot com
2012-09-07  8:30 ` redi at gcc dot gnu.org
2014-11-30 15:17 ` usack at math dot fu-berlin.de
2014-11-30 15:33 ` usack at math dot fu-berlin.de
2014-11-30 15:34 ` usack at math dot fu-berlin.de
2015-03-26  8:47 ` kariya_mitsuru at hotmail dot com
2021-08-27 23:34 ` pinskia at gcc dot gnu.org
2024-01-18  4:17 ` pinskia at gcc dot gnu.org
2024-01-18  5:44 ` thiago at kde dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).