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


> -------------
> namespace A { struct S {}; void f(S); }
> using A::f;
> namespace A { void f(double); }
> 
> int main()
> {
>   f(0.5);
> };
> -------------
> 
> I get: 
> 
> abs.cc: In function `int main ()':
> abs.cc:10: conversion from `double' to non-scalar type `A::S' requested
> 
> I believe that the "f" lookup should find both definitions of f,
> and apply overloading to disambiguate them.

Thanks for your bug report. This is not a bug in the compiler, but in
your code, see 7.3.3/9.

Regards,
Martin

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