This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42272] derived template default argument
- From: "debian dot templier at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Dec 2009 17:33:03 -0000
- Subject: [Bug c++/42272] derived template default argument
- References: <bug-42272-18525@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from debian dot templier at free dot fr 2009-12-04 17:33 -------
the pb is on line :
template < typename X , typename XT2 =T , typename X2 = typename XT2 ::
X > SMART(SMART<X> & value) : data(value.CastUp) {} ;
if i replace the line by
> template < typename XT2 = T , typename X2 = typename XT2 :: X >
> SMART(SMART<X2> & value) : data(value.CastUp()) {} ;
the constructor is find but i want an unherited constraint on X => X2 is
T::X
sh-3.2$ gcc-4.5-20091126/bin/g++ -std=c++0x -c main.cc
main.cc: In constructor ?SMART<T>::SMART(SMART<X2>&) [with XT2 = B, X2 =
A, T = B]?:
main.cc:45:13: instantiated from here
main.cc:17:118: erreur: no matching function for call to
?SMART<A>::CastUp()?
--
debian dot templier at free dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42272