* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
@ 2005-08-04 13:07 ` pinskia at gcc dot gnu dot org
2005-08-04 13:27 ` gdr at integrable-solutions dot net
` (7 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-04 13:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-04 13:07 -------
IIRC SFINAE does not mean not instantiating the template class.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
2005-08-04 13:07 ` [Bug c++/23227] " pinskia at gcc dot gnu dot org
@ 2005-08-04 13:27 ` gdr at integrable-solutions dot net
2005-08-05 4:02 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-08-04 13:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-08-04 13:26 -------
Subject: Re: SFINAE bug
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| IIRC SFINAE does not mean not instantiating the template class.
That is true. However, the real issue has nothing to do with SFINAE.
The compiler is just plain buggy.
Sylvain -- don't describe a plain compiler bug as SFINAE, otherwise
people might be sidetracked :-)
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
2005-08-04 13:07 ` [Bug c++/23227] " pinskia at gcc dot gnu dot org
2005-08-04 13:27 ` gdr at integrable-solutions dot net
@ 2005-08-05 4:02 ` pinskia at gcc dot gnu dot org
2005-09-14 15:35 ` bangerth at dealii dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-05 4:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-05 04:02 -------
I don't think this is a bug as A<C> will be tried to be instantiating while trying to convert it from float.
ICC gives the same result as GCC, an error.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
` (2 preceding siblings ...)
2005-08-05 4:02 ` pinskia at gcc dot gnu dot org
@ 2005-09-14 15:35 ` bangerth at dealii dot org
2005-09-14 21:03 ` gdr at integrable-solutions dot net
` (4 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: bangerth at dealii dot org @ 2005-09-14 15:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2005-09-14 15:35 -------
I believe the compiler is correct. In order to check whether there
is a conversion sequence from float to A<C>, it needs to instantiate the
type, parts of which are declared by incomplete. This should be an error.
icc says the same, whatever this means.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
` (3 preceding siblings ...)
2005-09-14 15:35 ` bangerth at dealii dot org
@ 2005-09-14 21:03 ` gdr at integrable-solutions dot net
2005-09-14 21:11 ` bangerth at dealii dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-09-14 21:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-09-14 21:03 -------
Subject: Re: SFINAE bug
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| I believe the compiler is correct. In order to check whether there
| is a conversion sequence from float to A<C>, it needs to instantiate the
| type, parts of which are declared by incomplete. This should be an error.
I don't think I agree.
Consider
stuct A;
void f(const A&) { }
void f(int) { }
void g()
{
f(2.0);
}
We don't reject the call in g() just because A happens to be incomplete
-- therefore we could not "look into" it for determining whether it
needs an implicit conversion or not. In another words, It is not
clear whether the completeness of A<C> is required in the testcase
submitted.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
` (4 preceding siblings ...)
2005-09-14 21:03 ` gdr at integrable-solutions dot net
@ 2005-09-14 21:11 ` bangerth at dealii dot org
2005-09-14 21:23 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: bangerth at dealii dot org @ 2005-09-14 21:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2005-09-14 21:10 -------
Fair enough. And to get more to the point of only using user-defined
conversion sequences (instead of the standard conversion from double
to int):
--------------------
struct A;
struct B { B(const double &); };
void f(const A&) { }
void f(const B&) { }
void g()
{
f(2.0);
}
----------------------
This is accepted by all compilers I have as well.
I retract my point of view. This doesn't mean, however, that I'm convinced
that the opposite would be true.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
` (5 preceding siblings ...)
2005-09-14 21:11 ` bangerth at dealii dot org
@ 2005-09-14 21:23 ` pinskia at gcc dot gnu dot org
2005-09-14 22:11 ` gdr at integrable-solutions dot net
2005-09-18 19:43 ` fang at csl dot cornell dot edu
8 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-14 21:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-14 21:23 -------
(In reply to comment #6)
> I retract my point of view. This doesn't mean, however, that I'm convinced
> that the opposite would be true.
But both of those testcases represent "void f(const B<C> &a); ".
Here is how I see it:
A<T> is instantiated because it is defined as a way too instantiate it and then we reject it as having
referencing an incomplete type.
The question here is should we be instantiating A<C>? I saw yes because otherwise we would reject
other valid code where A<C> defines a constructor taking double.
And the other question is if we instantiate A<C> should we be erroring out, I say yes as there is no part
of the standard as far as I can see says we should not error out here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
` (6 preceding siblings ...)
2005-09-14 21:23 ` pinskia at gcc dot gnu dot org
@ 2005-09-14 22:11 ` gdr at integrable-solutions dot net
2005-09-18 19:43 ` fang at csl dot cornell dot edu
8 siblings, 0 replies; 15+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-09-14 22:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-09-14 22:11 -------
Subject: Re: SFINAE bug
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Fair enough. And to get more to the point of only using user-defined
| conversion sequences (instead of the standard conversion from double
| to int):
| --------------------
| struct A;
| struct B { B(const double &); };
|
| void f(const A&) { }
| void f(const B&) { }
|
| void g()
| {
| f(2.0);
| }
| ----------------------
| This is accepted by all compilers I have as well.
|
| I retract my point of view. This doesn't mean, however, that I'm convinced
| that the opposite would be true.
In fact, I've come to be on the same position: I don't know. This is
probably something we need to forward to CWG.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23227] SFINAE bug
2005-08-04 9:30 [Bug c++/23227] New: SFINAE bug sylvain dot pion at sophia dot inria dot fr
` (7 preceding siblings ...)
2005-09-14 22:11 ` gdr at integrable-solutions dot net
@ 2005-09-18 19:43 ` fang at csl dot cornell dot edu
8 siblings, 0 replies; 15+ messages in thread
From: fang at csl dot cornell dot edu @ 2005-09-18 19:43 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |fang at csl dot cornell dot
| |edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23227
^ permalink raw reply [flat|nested] 15+ messages in thread