This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/383: C++v2,96:member template conversion not implicit
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: gcc-bugs at gcc dot gnu dot org, <gcc-gnats at gcc dot gnu dot org>
- Cc: jcampbell3 at prodigy dot net
- Date: Tue, 22 Oct 2002 17:14:06 -0500 (CDT)
- Subject: Re: c++/383: C++v2,96:member template conversion not implicit
This bug still applies with present CVS and 3.2. A slightly simpler to
read form of the report is this:
-----------------------------------------
template <bool P> struct X {
template <bool PP> operator X<PP>& (void);
};
int main(void) {
X<true> x;
static_cast<X<false> >(x);
X<false> y = x;
};
-----------------------------------------
The messages are
y.cc: In function `int main()':
y.cc:7: error: no matching function for call to `X<false>::X(X<true>&)'
y.cc:1: error: candidates are: X<false>::X()
y.cc:1: error: X<false>::X(const X<false>&)
y.cc:8: error: conversion from `X<true>' to non-scalar type `X<false>'
requested
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth