This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11919] New: int vs. typedef int bar
- From: "hans dot utz at informatik dot uni-ulm dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Aug 2003 12:24:47 -0000
- Subject: [Bug c++/11919] New: int vs. typedef int bar
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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)