Spot the bug in Invoice initialization

from Classes
C++23 intermediate 4 min 1 issue to find

Find the initialization-order bug in this invoice class.

C++
class Invoice {
public:
    explicit Invoice(int subtotal)
        : subtotal_(subtotal), tax_(subtotal_ / 10) {}
    int total() const { return subtotal_ + tax_; }
private:
    int tax_;
    int subtotal_;
};
Open in playground
Report an error