14.3.1/2
A local type, a type with no linkage, an unnamed type or a type compounded from any of these types shall not be used as a template-argument for a template type-parameter.
Try compiling your code with -std=c++0x option (gcc 4.5.1). C++0x lifts the restriction and so you can use a local type as template argument.