相关疑难解决方法(0)

Clang不会编译gcc会模板化的专门化

Gcc编译好了,但是Clang(trunk)拒绝了这个消息:

<source>:7:8: error: class template partial specialization is not more specialized than the primary template [-Winvalid-partial-specialization]
Run Code Online (Sandbox Code Playgroud)

https://godbolt.org/g/h8rsWC

template<class T, T x>
struct S{};

template<int& x>
struct S<int&, x> { };
Run Code Online (Sandbox Code Playgroud)

这段代码是否正确?

c++ gcc clang template-specialization language-lawyer

7
推荐指数
1
解决办法
191
查看次数