public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compile or not compile
@ 2004-07-01 13:42 Karo Szkudlarek
  2004-07-01 13:59 ` Eljay Love-Jensen
  0 siblings, 1 reply; 18+ messages in thread
From: Karo Szkudlarek @ 2004-07-01 13:42 UTC (permalink / raw)
  To: gcc-help

Hi!

The following program:

include <iostream>
typedef int my_int;

class A
{

public:
     enum Items
     {
         item1=1000,
         item2=2000
     };

//    typedef int my_int;
     int foo(const my_int&)
         {
             std::cerr << "int\n";
             return 0;
         }
     int foo(const bool&)
         {
             std::cerr << "bool\n";
             return 0;
         }
};

int main()
{
     A a;
     a.foo(A::item1);
     return 0;
}

on my platform (Suse Linux, gcc 3.3.3) does not compile. Returns errors:
testtypedef.cpp: In function `int main()':
testtypedef.cpp:30: error: call of overloaded `foo(A::Items)' is ambiguous
testtypedef.cpp:16: error: candidates are: int A::foo(const my_int&)
testtypedef.cpp:21: error:                 int A::foo(const bool&)

I posted my problem to compl.lang.c++ and I got answer that
reason for this is compiler bug. I don't know how can I avoid it.
My program compiles fine on another linuxes with gcc 3.3.3 for
example gentoo and debian. Also I posted my problem to Suse support
but got answer that:

"So far, we are not aware about any problem in this package."

says about gcc package.

Any ideas what can I do now? Is it compiler bug or not... I am very 
confused...

Greets,
Karol Szkudlarek

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

end of thread, other threads:[~2004-07-20  9:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-01 13:42 compile or not compile Karo Szkudlarek
2004-07-01 13:59 ` Eljay Love-Jensen
2004-07-01 14:39   ` Purnendu/Gmail
2004-07-01 14:44     ` Eljay Love-Jensen
2004-07-01 20:48   ` Karol Szkudlarek
2004-07-01 20:54     ` Eljay Love-Jensen
2004-07-02  8:01       ` Karol Szkudlarek
2004-07-02  5:59     ` llewelly
2004-07-02  8:09       ` Karol Szkudlarek
2004-07-02 12:22         ` Eljay Love-Jensen
2004-07-02 13:46           ` llewelly
2004-07-02 13:58             ` Eljay Love-Jensen
2004-07-02 19:57               ` llewelly
2004-07-02 20:12                 ` Eljay Love-Jensen
2004-07-02 20:31                   ` llewelly
2004-07-19  6:06       ` Alexandre Oliva
2004-07-19 19:21         ` Karol Szkudlarek
2004-07-20  9:59           ` Alexandre Oliva

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).