[Bug c++/11919] New: int vs. typedef int bar
hans dot utz at informatik dot uni-ulm dot de
gcc-bugzilla@gcc.gnu.org
Thu Aug 14 12:24:00 GMT 2003
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)
More information about the Gcc-bugs
mailing list