[Bug c++/42296] template : missing in analyse of possible constructor

2009-12-05 Thread debian dot templier at free dot fr


--- Comment #3 from debian dot templier at free dot fr  2009-12-05 10:58 
---
missing in analyse of possible constructor :
template   typename X , typename XT2 = T , typename X2 = typename XT2 :: X 
SMART(SMARTX  value) : data(value.operator T* ()) {} ;

with X=A XT2=T X2=T::A (X2 is unherited constraint(B is public derived of A ),
XT2 is to delayed analyse of X2 at instanciation)

you must change the resolution state :

there is a probleme of matching with typename X2 = typename XT2 :: X =A then
find the constructor possible for analyse in gcc constructors matching miss

the reason is the scope typename X2 = typename XT2 :: X with X in template 
 typename X ...  , i suppose X is not search in template parameter ...

bug 42296 replace 42272


-- 

debian dot templier at free dot fr changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|DUPLICATE   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42296



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

2009-12-04 Thread debian dot templier at free dot fr


--- Comment #3 from debian dot templier at free dot fr  2009-12-04 17:12 
---
Subject: Re:  derived template default argument

redi at gcc dot gnu dot org wrote:
 --- Comment #2 from redi at gcc dot gnu dot org  2009-12-04 09:48 ---
 SMARTA a();

 This does not declare an object of type SMARTA, it declares a function 
 called
 'a' which returns SMARTA

 You need to change that to:

 SMARTA a;

 or

 SMARTA a = SMARTA();


   
the pb is on line :
template  typename X , typename XT2 =T , typename X2 = typename XT2 :: 
X  SMART(SMARTX  value) : data(value.CastUp) {} ;

if i replace the line by
 template  typename XT2 = T , typename X2 = typename XT2 :: X  
 SMART(SMARTX2  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 ‘SMARTT::SMART(SMARTX2) [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 
‘SMARTA::CastUp()’


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42272



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

2009-12-04 Thread debian dot templier at free dot fr


--- 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(SMARTX  value) : data(value.CastUp) {} ;

if i replace the line by
 template  typename XT2 = T , typename X2 = typename XT2 :: X  
 SMART(SMARTX2  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 ‘SMARTT::SMART(SMARTX2) [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 
‘SMARTA::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



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

2009-12-04 Thread debian dot templier at free dot fr


--- Comment #6 from debian dot templier at free dot fr  2009-12-04 17:39 
---

i want a constructor on template class SMARTT with reference parameter on
SMARTX  value with the constraint of T on SMART instanciation is

T is unherited of X

class A
{
} ;

class B : virtual public A
{
} ;

where T is B and X is A 

thanks


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42272



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

2009-12-04 Thread debian dot templier at free dot fr


--- Comment #7 from debian dot templier at free dot fr  2009-12-04 17:44 
---
template  typename X , typename XT2 =T , typename X2 = typename XT2 :: 
X  SMART(SMARTX  value) : data(value.CastUp) {} ;

The code to do the constructor 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42272



[Bug c++/42296] New: template : missing in analyse of possible constructor

2009-12-04 Thread debian dot templier at free dot fr
template  typename T 
class SMART
{ T * data ;
public :

T * Get() {return(data); } ;

SMART( ) : data(__null) {} ;

SMART( T* value ) : data(value) {} ;

SMART(SMARTT  value) : data(value.Get()) {} ;

template   typename X , typename XT2 = T , typename X2 = typename X :: XT2  
operator X * () {return(dynamic_castX(data)); } ;

template   typename X , typename XT2 = T , typename X2 = typename XT2 :: X 
SMART(SMARTX  value) : data(value.operator T* ()) {} ;

~SMART() {} ;

} ;

class A
{
public :

A() {} ;

~A() {} ;

} ;

class B : virtual public A
{
public :

B() {} ;

~B() {} ;

} ;

int method()
{SMARTA a;
SMARTB b(a) ;
} ;

sh-3.2$ gcc-4.5-20091203/bin/g++ -std=c++0x -c main.cc
main.cc: In function ‘int method()’:
main.cc:45:13: erreur: no matching function for call to
‘SMARTB::SMART(SMARTA)’
main.cc:13:1: note: candidats sont: SMARTT::SMART(SMARTT) [with T = B]
main.cc:11:1: note: SMARTT::SMART(T*) [with T = B]
main.cc:9:1: note: SMARTT::SMART() [with T = B]

missing in analyse of possible constructor :
template   typename X , typename XT2 = T , typename X2 = typename XT2 :: X 
SMART(SMARTX  value) : data(value.operator T* ()) {} ;

with X=A XT2=T X2=T::A (X2 is unherited constraint(B is public derived of A ),
XT2 is to delayed analyse of X2 at instanciation)

context :
gcc-4.5-20091203/bin/g++  -v -save-temps -std=c++0x -c main.cc
Utilisation des specs internes.
COLLECT_GCC=gcc-4.5-20091203/bin/g++
COLLECT_LTO_WRAPPER=/home/admin/webTmp/gcc/gcc-4.5-20091203/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configuré avec: ./configure --prefix=/home/admin/webTmp/gcc/gcc-4.5-20091203
--exec-prefix=/home/admin/webTmp/gcc/gcc-4.5-20091203
--libdir=/home/admin/webTmp/gcc/gcc-4.5-20091203/lib --disable-multilib
--enable-checking=release --with-tune=generic --enable-mpfr
--enable-libstdcxx-debug --enable-clocale=gnu --enable-nls
--enable-threads=posix --without-included-gettext --with-system-zlib
--enable-linker-build-id --enable-multiarch
Modèle de thread: posix
gcc version 4.5.0 20091203 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc'
'-mtune=generic'

/home/admin/webTmp/gcc/gcc-4.5-20091203/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-E -quiet -v -D_GNU_SOURCE main.cc -mtune=generic -std=c++0x -fpch-preprocess
-o main.ii
le répertoire «
/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/include
» est ignoré car inexistant
la recherche pour #include ... débute ici :
la recherche pour #include ... débute ici:

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/x86_64-unknown-linux-gnu

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/backward
 /usr/local/include
 /home/admin/webTmp/gcc/gcc-4.5-20091203/include

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include-fixed
 /usr/include
Fin de la liste de recherche.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc'
'-mtune=generic'

/home/admin/webTmp/gcc/gcc-4.5-20091203/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-fpreprocessed main.ii -quiet -dumpbase main.cc -mtune=generic -auxbase main
-std=c++0x -version -o main.s
GNU C++ (GCC) version 4.5.0 20091203 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091203 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p2
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.5.0 20091203 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091203 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p2
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 532cbbb99e00eba27362d9a175c3b08d
main.cc: In function ‘int method()’:
main.cc:45:13: erreur: no matching function for call to
‘SMARTB::SMART(SMARTA)’
main.cc:13:1: note: candidats sont: SMARTT::SMART(SMARTT) [with T = B]
main.cc:11:1: note: SMARTT::SMART(T*) [with T = B]
main.cc:9:1: note: SMARTT::SMART() [with T = B]


-- 
   Summary: template : missing in analyse of possible constructor
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian dot templier at free dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42296



[Bug c++/42297] New: template : missing in analyse of possible constructor

2009-12-04 Thread debian dot templier at free dot fr
template  typename T 
class SMART
{ T * data ;
public :

T * Get() {return(data); } ;

SMART( ) : data(__null) {} ;

SMART( T* value ) : data(value) {} ;

SMART(SMARTT  value) : data(value.Get()) {} ;

template   typename X , typename XT2 = T , typename X2 = typename X :: XT2  
operator X * () {return(dynamic_castX(data)); } ;

template   typename X , typename XT2 = T , typename X2 = typename XT2 :: X 
SMART(SMARTX  value) : data(value.operator T* ()) {} ;

~SMART() {} ;

} ;

class A
{
public :

A() {} ;

~A() {} ;

} ;

class B : virtual public A
{
public :

B() {} ;

~B() {} ;

} ;

int method()
{SMARTA a;
SMARTB b(a) ;
} ;

sh-3.2$ gcc-4.5-20091203/bin/g++ -std=c++0x -c main.cc
main.cc: In function ‘int method()’:
main.cc:45:13: erreur: no matching function for call to
‘SMARTB::SMART(SMARTA)’
main.cc:13:1: note: candidats sont: SMARTT::SMART(SMARTT) [with T = B]
main.cc:11:1: note: SMARTT::SMART(T*) [with T = B]
main.cc:9:1: note: SMARTT::SMART() [with T = B]

missing in analyse of possible constructor :
template   typename X , typename XT2 = T , typename X2 = typename XT2 :: X 
SMART(SMARTX  value) : data(value.operator T* ()) {} ;

with X=A XT2=T X2=T::A (X2 is unherited constraint(B is public derived of A ),
XT2 is to delayed analyse of X2 at instanciation)

context :
gcc-4.5-20091203/bin/g++  -v -save-temps -std=c++0x -c main.cc
Utilisation des specs internes.
COLLECT_GCC=gcc-4.5-20091203/bin/g++
COLLECT_LTO_WRAPPER=/home/admin/webTmp/gcc/gcc-4.5-20091203/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configuré avec: ./configure --prefix=/home/admin/webTmp/gcc/gcc-4.5-20091203
--exec-prefix=/home/admin/webTmp/gcc/gcc-4.5-20091203
--libdir=/home/admin/webTmp/gcc/gcc-4.5-20091203/lib --disable-multilib
--enable-checking=release --with-tune=generic --enable-mpfr
--enable-libstdcxx-debug --enable-clocale=gnu --enable-nls
--enable-threads=posix --without-included-gettext --with-system-zlib
--enable-linker-build-id --enable-multiarch
Modèle de thread: posix
gcc version 4.5.0 20091203 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc'
'-mtune=generic'

/home/admin/webTmp/gcc/gcc-4.5-20091203/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-E -quiet -v -D_GNU_SOURCE main.cc -mtune=generic -std=c++0x -fpch-preprocess
-o main.ii
le répertoire «
/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/include
» est ignoré car inexistant
la recherche pour #include ... débute ici :
la recherche pour #include ... débute ici:

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/x86_64-unknown-linux-gnu

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/backward
 /usr/local/include
 /home/admin/webTmp/gcc/gcc-4.5-20091203/include

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include

/home/admin/webTmp/gcc/gcc-4.5-20091203/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include-fixed
 /usr/include
Fin de la liste de recherche.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc'
'-mtune=generic'

/home/admin/webTmp/gcc/gcc-4.5-20091203/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-fpreprocessed main.ii -quiet -dumpbase main.cc -mtune=generic -auxbase main
-std=c++0x -version -o main.s
GNU C++ (GCC) version 4.5.0 20091203 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091203 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p2
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.5.0 20091203 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091203 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p2
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 532cbbb99e00eba27362d9a175c3b08d
main.cc: In function ‘int method()’:
main.cc:45:13: erreur: no matching function for call to
‘SMARTB::SMART(SMARTA)’
main.cc:13:1: note: candidats sont: SMARTT::SMART(SMARTT) [with T = B]
main.cc:11:1: note: SMARTT::SMART(T*) [with T = B]
main.cc:9:1: note: SMARTT::SMART() [with T = B]


-- 
   Summary: template : missing in analyse of possible constructor
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian dot templier at free dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42297



[Bug c++/42272] New: derived template deafult argument

2009-12-03 Thread debian dot templier at free dot fr
hello ,

i have a problem on default template argument , for statement SMARTB b(a) ;
the good constructor is not in constructor choice for G++ .


thanks for help

template  typename T 
class SMART
{ T * data ;
public :

T * Get() {return(data); } ;

SMART( T* value ) : data(value) {} ;

SMART(SMARTT  value) : data(value.Get()) {} ;

template  typename X , typename X2 = typename X :: T   X2 * CastUp()
{return(dynamic_castX2(data)); } ;

template  typename X , typename XT2 = T , typename X2 = typename XT2 :: X 
SMART(SMARTX2  value) : data(value.CastUp()) {} ;

~SMART() {} ;

} ;

class A
{
public :

A() {} ;

~A() {} ;

} ;

class B : virtual public A

{
public :

B() {} ;

~B() {} ;

} ;

int method()
{SMARTA a();
SMARTB b(a) ;
} ;
cat configure.shl
#!/bin/sh
export GCC_DIR=`pwd`
echo GCC_DIR
./configure --prefix=$GCC_DIR --exec-prefix=$GCC_DIR --libdir=$GCC_DIR/lib
--disable-multilib --enable-checking=release --with-tune=generic --enable-mpfr
--enable-libstdcxx-debug  --enable-clocale=gnu --enable-nls
--enable-threads=posix --without-included-gettext --with-system-zlib
--enable-linker-build-id --enable-multiarch
make
make install

gcc-4.5-20091126/bin/g++ -std=c++0x -c main.cc

main.cc: In function ‘int method()’:
main.cc:43:13: erreur: no matching function for call to
‘SMARTB::SMART(SMARTA ()())’
main.cc:11:1: note: candidats sont: SMARTT::SMART(SMARTT) [with T = B]
main.cc:9:1: note: SMARTT::SMART(T*) [with T = B]


gcc-4.5-20091126/bin/g++  -v -save-temps -std=c++0x -c main.cc
Utilisation des specs internes.
COLLECT_GCC=gcc-4.5-20091126/bin/g++
COLLECT_LTO_WRAPPER=/home/admin/webTmp/gcc/gcc-4.5-20091126/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configuré avec: ./configure --prefix=/home/admin/webTmp/gcc/gcc-4.5-20091126
--exec-prefix=/home/admin/webTmp/gcc/gcc-4.5-20091126
--libdir=/home/admin/webTmp/gcc/gcc-4.5-20091126/lib --disable-multilib
--enable-checking=release --with-tune=generic --enable-mpfr
--enable-libstdcxx-debug --enable-clocale=gnu --enable-nls
--enable-threads=posix --without-included-gettext --with-system-zlib
--enable-linker-build-id --enable-multiarch
Modèle de thread: posix
gcc version 4.5.0 20091126 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc'
'-mtune=generic'

/home/admin/webTmp/gcc/gcc-4.5-20091126/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-E -quiet -v -D_GNU_SOURCE main.cc -mtune=generic -std=c++0x -fpch-preprocess
-o main.ii
le répertoire «
/home/admin/webTmp/gcc/gcc-4.5-20091126/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/include
» est ignoré car inexistant
la recherche pour #include ... débute ici :
la recherche pour #include ... débute ici:

/home/admin/webTmp/gcc/gcc-4.5-20091126/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0

/home/admin/webTmp/gcc/gcc-4.5-20091126/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/x86_64-unknown-linux-gnu

/home/admin/webTmp/gcc/gcc-4.5-20091126/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/backward
 /usr/local/include
 /home/admin/webTmp/gcc/gcc-4.5-20091126/include

/home/admin/webTmp/gcc/gcc-4.5-20091126/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include

/home/admin/webTmp/gcc/gcc-4.5-20091126/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include-fixed
 /usr/include
Fin de la liste de recherche.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc'
'-mtune=generic'

/home/admin/webTmp/gcc/gcc-4.5-20091126/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-fpreprocessed main.ii -quiet -dumpbase main.cc -mtune=generic -auxbase main
-std=c++0x -version -o main.s
GNU C++ (GCC) version 4.5.0 20091126 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091126 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p2
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.5.0 20091126 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091126 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p2
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 55f055424d661ccac322b63c97c280de
main.cc: In function ‘int method()’:
main.cc:43:13: erreur: no matching function for call to
‘SMARTB::SMART(SMARTA ()())’
main.cc:11:1: note: candidats sont: SMARTT::SMART(SMARTT) [with T = B]
main.cc:9:1: note: SMARTT::SMART(T*) [with T = B]


-- 
   Summary: derived template deafult argument
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian dot templier at free dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42272



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

2009-12-03 Thread debian dot templier at free dot fr


--- Comment #1 from debian dot templier at free dot fr  2009-12-04 06:03 
---


template  typename X , typename X2 = typename X :: T   X * CastUp()
{return(dynamic_castX2(data)); } ;


-- 

debian dot templier at free dot fr changed:

   What|Removed |Added

 CC||debian dot templier at free
   ||dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42272