  In 1962, Erd\H{o}s proved that if a graph $G$ with $n$ vertices satisfies $$
e(G)>\max\left\{\binom{n-k}{2}+k^2,\binom{\lceil(n+1)/2\rceil}{2}+\left\lfloor
\frac{n-1}{2}\right\rfloor^2\right\}, $$ where the minimum degree
$\delta(G)\geq k$ and $1\leq k\leq(n-1)/2$, then it is Hamiltonian. For $n \geq
2k+1$, let $E^k_n=K_{k}\vee (kK_1+K_{n-2k})$, where "$\vee$" is the "join"
operation. One can observe $e(E^k_n)=\binom{n-k}{2}+k^2$ and $E^k_n$ is not
Hamiltonian. As $E^k_n$ contains induced claws for $k\geq 2$, a natural
question is to characterize all 2-connected claw-free non-Hamiltonian graphs
with the largest possible number of edges. We answer this question completely
by proving a claw-free analog of Erd\H{o}s' theorem. Moreover, as byproducts,
we establish several tight spectral conditions for a 2-connected claw-free
graph to be Hamiltonian. Similar results for the traceability of connected
claw-free graphs are also obtained. Our tools include Ryj\'a\v{c}ek's claw-free
closure theory and Brousek's characterization of minimal 2-connected claw-free
non-Hamiltonian graphs.
