This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53236] using declaration and base function template overloading
- From: "fpelliccioni at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 May 2012 13:58:38 +0000
- Subject: [Bug c++/53236] using declaration and base function template overloading
- Auto-submitted: auto-generated
- References: <bug-53236-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53236
--- Comment #10 from Fernando Pelliccioni <fpelliccioni at gmail dot com> 2012-05-07 13:58:38 UTC ---
(In reply to comment #9)
> (In reply to comment #8)
> [..]
> > Here the corrected code with proper comments.
> [..]
> > auto yyy = d.get<int>(); // #ifndef WITH_USING_DECLARATION ->
> > Compile-time error -> GCC is behaving Correctly!!! Base<int>::get<int>() is
> > hidden!
> > // #ifdef WITH_USING_DECLARATION -> No
> > Compile-time error -> GCC is behaving incorrectly. Base<int>::get<int>() must
> > be hidden.
>
> Its a mystery to me why get() should return an T2 when the return type is T,
> but anyway: I cannot confirm your results for gcc 4.8.0 20120429
> (experimental). Here the second case is correctly rejected.
T and T2 are the same type. It is the same, could be... return T();
I'm glad that is resolved in 4.8.0
I can't test it, I don't have that version.
Thanks!