The Wikipedia article gives an interesting example of the Gauss-Bonnet theorem:
As an application, a torus has Euler characteristic 0, so its total curvature must also be zero. ... It is also possible to construct a torus by identifying opposite sides of a square, in which case the Riemannian metric on the torus is flat and has constant curvature 0, again resulting in total curvature 0.
But there are of course other ways of closing up the square by identifying points on its boundary. If we identify opposite sides with one pair's orientation flipped, we get the Klein bottle, which also has Euler characteristic 0. But if we flip both pair's orientations then we get the real projective plane, which has Euler characteristic 1. And if we identify the entire boundary together then we get the sphere, with Euler characteristic 2. These are all closed surfaces so the Gauss-Bonnet theorem would naively imply that their total curvature equals $2\pi$ times their Euler characteristic, but this only works for the torus and Klein bottle identifications, but not the real projective plane or sphere identifications. Why?
For concreteness, consider the manifold $M$, the closed square (or unit disk) quotiented by its boundary. I think that $M$ has the topological structure of $S^2$ but not the differential structure - i.e. it's homeomorphic but not diffeomorphic to $S^2$. Is this correct? But $M$ can't be an exotic sphere because they don't exist in two dimensions, so it must not be a differentiable manifold at all. If I'm correct, then the identification process means that $M$ is not actually differentiable at the point which is the identified boundary - it's perfectly homogenous as a topological manifold, but fails to be a differentiable manifold because there's one problematic point at which the Gaussian curvature is undefined. Similarly, I guess the identified-edge square is homeomorphic but not diffeomorphic to the real projective plane? Then are the squares with the torus and Klein bottle identifications differentiable at the identified edges and corners? If so, why are the torus- and Klein-bottle-identified squares differentiable at their boundary but not the RPP- and sphere-identified squares?