Here is the code which confuses me:

```
#include <iostream>
using namespace std;

class B {
public:
    B() {
        cout << "constructor\n";
    }
    B(const B& rhs) {
        cout << "copy ctor\n";
    }
    B & operator=(const B & rhs) {
        cout << "assignment\n";
    }
    ~B() {
        cout << "destructed\n";
    }
    B(int i) : data(i) {
        cout << "constructed by parameter " << data << endl;
    }

private:
    int data;
};

B play(B b)
{
    return b;
}

int main(int argc, char *argv[])
{
#if 1
    B t1;
    t1 =  play(5);
#endif

#if 0
    B t1 = play(5);
#endif

    return 0;
}

```

Environment is g++ 4.6.0 on Fedora 15.
The first code fragment output is as follows:

```
constructor
constructed by parameter 5
copy ctor
assignment
destructed
destructed
destructed

```

And the second fragment code output is:

```
constructed by parameter 5
copy ctor
destructed
destructed

```

Why are are three destructors are called in the first example, while in the second it is only two?