[Bug c++/29577] overload/SFINAE problem

2009-12-08 Thread redi at gcc dot gnu dot org


--- Comment #5 from redi at gcc dot gnu dot org  2009-12-08 11:21 ---
'typename X::T*' is a non-deduced context, so should not be involved in
argument deduction, and 0 is a valid null pointer constant


*** This bug has been marked as a duplicate of 23055 ***


-- 

redi at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29577



[Bug c++/29577] overload/SFINAE problem

2006-11-01 Thread bangerth at dealii dot org


--- Comment #4 from bangerth at dealii dot org  2006-11-01 22:57 ---
You don't need a cast when converting to pointer, but the data
type of 0 is still int. When determining the type of a template
parameter, it therefore tries to to make the template parameter 'int'.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29577



[Bug c++/29577] overload/SFINAE problem

2006-10-23 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2006-10-24 00:56 ---
This code compiles for me with 4.2.0 and 4.0.2.
As I understand this, in the Y case the first template overload gets rejected
as X::T does not exist.  In the X case, the first template is an exact match so
it matches that way.

Also Comeau C++ accepts the code.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   GCC host triplet|powerpc-ibm-aix4.3.3.0  |
 GCC target triplet||powerpc-ibm-aix4.3.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29577



[Bug c++/29577] overload/SFINAE problem

2006-10-23 Thread bangerth at dealii dot org


--- Comment #2 from bangerth at dealii dot org  2006-10-24 02:21 ---
I'm not completely sure who's right and wrong, but here's what's happening:
the second argument in the X case is an integer (the number zero), not
an int*. Consequently, the first template is not an exact match, but
requires a cast. Gcc then takes the second template with the ellipsis
instead and produces the output
-
hasn't Z::T
hasn't Z::T
-
with all versions I have here (2.95...4.2pre). If you change the last
argument to (int*)0, then you get what you probably expect.

For the record, I also get this here:
-
g/x icc -Xc -ansi x.cc
g/x ./a.out 
has Z::T
hasn't Z::T
-

W.


-- 

bangerth at dealii dot org changed:

   What|Removed |Added

 CC||bangerth at dealii dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29577



[Bug c++/29577] overload/SFINAE problem

2006-10-23 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2006-10-24 02:30 ---
Oh, I read the bug incorrectly.
As I understand it 0 is special as it is also the NULL pointer and you don't
need a cast for it to assign a pointer to it.  Maybe we forget to take that
into account.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29577