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]

RE: c++/9942: Function Overload Resolution calls wrong function on variable length parameter lists


> Attached is sample code to exhibit this. 

OK, here's a reduced example:
------------------------
#include <stdarg.h>

void f(int, va_list&)  ;   // only declared
void f(int, ...)     {};   // defined

int main () {
  char *p;
  f(1, p);         // should probably call second f()
}
------------------------

This compiles and links fine with 2.95, but not with 3.2.1. Will have to 
check on that other system what happens with 3.3 and mainline.

W.

Here's the result:
tmp/g> ~/bin/gcc-3.2.1/bin/c++ x.cc
/tmp/ccOD0xO1.o: In function `main':
/tmp/ccOD0xO1.o(.text+0x25): undefined reference to `f(int, char*&)'
collect2: ld returned 1 exit status

-------------------------------------------------------------------------
Wolfgang Bangerth             email:            bangerth at ticam dot utexas dot edu
                              www: http://www.ticam.utexas.edu/~bangerth/



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