Commit ede3cf23 by Jason Merrill

cvt.c (convert_lvalue): New fn.

        * cvt.c (convert_lvalue): New fn.
        * cp-tree.h: Declare it.
        * method.c (do_build_assign_ref): Use it.
        (do_build_copy_constructor): Convert parm to base types
        before calling base constructors.

From-SVN: r43798
parent 1e4ce346
...@@ -6,6 +6,8 @@ extern "C" void exit(int); ...@@ -6,6 +6,8 @@ extern "C" void exit(int);
class A; class A;
class B; class B;
int c;
class A { class A {
public: public:
...@@ -30,6 +32,7 @@ public: ...@@ -30,6 +32,7 @@ public:
virtual ~B(void){} virtual ~B(void){}
void print(void) const { void print(void) const {
++c;
printf("B::print\n"); printf("B::print\n");
} }
...@@ -50,6 +53,14 @@ int main () ...@@ -50,6 +53,14 @@ int main ()
{ {
A titi; A titi;
A toto = titi.compute(); A toto = titi.compute();
if (c != 1)
{
printf ("FAIL\n");
return 1;
}
else
{
printf("PASS\n"); printf("PASS\n");
return 0; return 0;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment