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++/11919] New: int vs. typedef int bar


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: int vs. typedef int bar
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hans dot utz at informatik dot uni-ulm dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The following code fails to compile with 3.4 when int is substitued by a typedef
to int. 

==== 

void foo(signed char) {}

#ifdef ERROR
  typedef int bar;
  void foo(bar) {}
#else
  void foo(int) {}
#endif

int main (int, char **) {
  char c;
  foo(c);
  return 0;
}

====

g++ -DERROR 
reports:

foo.cpp: In function `int main(int, char**)':
foo.cpp:12: error: call of overloaded `foo(char&)' is ambiguous
foo.cpp:1: note: candidates are: void foo(signed char)
foo.cpp:5: note:                 void foo(bar)


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