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]
Other format: [Raw text]

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



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