public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38030]  New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6"
@ 2008-11-06 10:25 ashutosh dot nema at nechclst dot in
  2008-11-06 11:52 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: ashutosh dot nema at nechclst dot in @ 2008-11-06 10:25 UTC (permalink / raw)
  To: gcc-bugs

Dear All,

I am unable to understand following test case behaviour.
When i compile and execute this with g++ 3.4.6 it works fine.
But when i compile and execute this with g++ 4.3.2 it aborts.

I think the test case is OK.
But g++ 4.3.2 having bug.

Below is test case:
==========================================================

#define ieq(X,Y) if((X)!=(Y)) abort();
extern void abort ();
struct B_
{
  int i;
};
struct D_:public B_
{
};
D_ d_;
int f_ (B_ &)
{
  return 100;
}
template < class T > int g_ (T t)
{
  return f_ (d_) + f_ (t);
}
int f_ (D_ &)
{
  return 1;
}
int main (int argc, char *argv[])
{
  D_ d;
  ieq (g_ (d), 101);
  return 0;
}
==========================================================

Please help me regarding this.


-- 
           Summary: g++ template with overloaded function behave differently
                    on "g++ 4.3.2" and "g++ 3.4.6"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ashutosh dot nema at nechclst dot in


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


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

end of thread, other threads:[~2009-04-03 18:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
2008-11-06 11:52 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2008-11-06 11:54 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong rguenth at gcc dot gnu dot org
2008-11-06 12:09 ` rguenth at gcc dot gnu dot org
2008-11-06 12:56 ` rguenth at gcc dot gnu dot org
2008-11-06 12:56 ` jakub at gcc dot gnu dot org
2008-11-14 18:31 ` jason at gcc dot gnu dot org
2008-11-14 22:00 ` jason at gcc dot gnu dot org
2008-11-14 22:04 ` [Bug c++/38030] [4.2/4.3 " jason at gcc dot gnu dot org
2008-11-14 23:08 ` jason at gcc dot gnu dot org
2008-11-14 23:17 ` jason at gcc dot gnu dot org
2008-11-14 23:29 ` rguenther at suse dot de
2009-03-24  5:14 ` pinskia at gcc dot gnu dot org
2009-03-31 15:43 ` jason at gcc dot gnu dot org
2009-04-02 18:38 ` jason at gcc dot gnu dot org
2009-04-03 18:05 ` jason at gcc dot gnu 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).