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]

Re: Bad C++ using-declaration semantics



My previous posting on this subject had the wrong test case.
(Apologies for the confusion.)  Here is the correct report.

Given:

-------------
namespace A { struct S {}; void f(S); }
using A::f;
namespace A { void f(double); }
using A::f;

int main()
{
  f(0.5);
};
-------------

I get: 

----
abs.cc: In function `int main ()':
abs.cc:10: parameter type of called function is incomplete
----

Overload resolution should find A::f(double).  Instead, it
is only seeing A::f(A::S).  

Another problem is that the error message is wrong; A::S is
a complete type.

This bug interferes with progress on libstdc++-v3.

Nathan Myers
ncm at cantrip dot org

--------------------------------------------------
Reading specs from v3/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000515 (experimental)
 v3/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.96/cpp -lang-c++ \
 -v -iprefix v3/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.96/ \
 -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 \
 -D__cplusplus -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ \
 -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) \
 -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_pentiumpro__ \
 abs.cc /tmp/ccDcLkmK.ii
GNU CPP version 2.96 20000515 (experimental) (cpplib)
 (i386 Linux/ELF)
ignoring duplicate directory `/home/ncm/Libc/v3/include/g++-v3'
ignoring duplicate directory `/home/ncm/Libc/v3/lib/gcc-lib/i686-pc-linux-gnu/2.96/include'
ignoring duplicate directory `/home/ncm/Libc/v3/i686-pc-linux-gnu/include'
#include "..." search starts here:
#include <...> search starts here:
 v3/include/g++-v3
 v3/lib/gcc-lib/i686-pc-linux-gnu/2.96/include
 v3/i686-pc-linux-gnu/include
 /home/ncm/Libc/v3/include
 /usr/include
End of search list.
 v3/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.96/cc1plus /tmp/ccDcLkmK.ii -quiet -dumpbase abs.cc -version -o /tmp/ccSzaWik.s
GNU C++ version 2.96 20000515 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 2.95.2 20000313 (Debian GNU/Linux).
abs.cc: In function `int main ()':
abs.cc:10: parameter type of called function is incomplete

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