Lambda capture dangling reference

What is the issue with the following code?

#include <functional>
std::function<int()> makeCounter() {
    int count = 0;
    return [&count]() { return ++count; };
}
int main() {
    auto f = makeCounter();
    return f();
}
A

No issue: this is well-defined and returns 1.

B

The lambda cannot capture local variables.

C

The returned lambda holds a dangling reference to a destroyed local variable.

D

The code compiles but always returns 0.