This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14189] New: template inlining failed warning - with optimization -O2


swlab35:39> cat Y.cpp
// Following fails when compiled by g++-3.3.1 with:
//   g++ -O2 -fno-exceptions -Winline -Werror
class Gin
{
 public:
    Gin();
    virtual ~Gin() {}
    void up() const;
}; // Gin

template<class T>
class Kup
{
    public:
        Kup(): _p(0) {}
        Kup(T p): _p(p) {
            if (_p)
            {
                _p->up();
            }
        }
    T _p;
}; // Kup


class HCABase : public Gin
{
 public:
    HCABase();
    virtual ~HCABase();
}; /* HCABase */

class WQ
{
 public:
    WQ(HCABase* h);
    virtual ~WQ();
    Kup<HCABase*>     _hca;
}; // WQ


WQ::WQ(HCABase* h) :
    _hca(h)
{
} // WQ::WQ
swlab35:40> g++ -O2 -fno-exceptions -Winline -c -o /tmp/Y.o Y.cpp
Y.cpp: In member function `WQ::WQ(HCABase*)':
Y.cpp:16: warning: inlining failed in call to `Kup<T>::Kup(T) [with T = 
   HCABase*]'
Y.cpp:44: warning: called from here
Y.cpp: In member function `WQ::WQ(HCABase*)':
Y.cpp:16: warning: inlining failed in call to `Kup<T>::Kup(T) [with T = 
   HCABase*]'
Y.cpp:44: warning: called from here
swlab35:41>

-- 
           Summary: template inlining failed warning - with optimization -O2
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yotamm at mellanox dot co dot il
                CC: gcc-bugs at gcc dot gnu dot org,yotamm at mellanox dot
                    co dot il
  GCC host triplet: i586-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14189


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]