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

class CCC {
public:
    CCC() {cout<<"created "<<++count<<endl;}
    ~CCC(){cout<<"deleted "<<--count<<endl;}
    int count=0;
};

CCC a;

CCC& create() { 
    return a; 
}

int main () {
    CCC result = create();
}

```

<https://godbolt.org/z/K3eR9t>

The above code produces strange output. Looks like the destructor is called 2 times, but count is not decremented. Why is that?

```
created 1
deleted 0
deleted 0

```