显式专业化中不允许存储类

Reg*_*00x 4 c++ gcc

我在不属于类的头文件中有以下代码:

template<typename Foo> static const Compl<Foo,bar> *foobar (const FBTYPE &x);

template<> static const Compl<typea,bar> *foobar<typea>(const FBTYPE &x) {
    return x.funcA();
}

template<> static const Compl<typeb,bar> *foobar<typeb>(const FBTYPE &x) {
    return x.funcB();
}
Run Code Online (Sandbox Code Playgroud)

代码使用较旧的GCC版本编译得很好,但在较新的版本中,我收到此错误消息:

rsvt.h(672): error #3503: a storage class is not allowed in an explicit specialization
  template<> static const Compl<typea,bar> *foobar<typea>(const FBTYPE &x) {
             ^
Run Code Online (Sandbox Code Playgroud)

知道为什么它适用于较旧版本的GCC但不适用于较新版本的GCC吗?另外,如何让它与GCC 5一起使用?

Mar*_* A. 5

原因在于以下引用,现在是C++标准: [dcl.stc]/p1

不应在显式特化中指定thread_local以外的存储类说明符