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]

[Bug c++/42272] derived template default argument



------- 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


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