0
以下代码与Clang(4.0)和GCC(6.3)一起编译,但使用MSVC(Visual Studio 2015 Update 1,Visual Studio 2017)失败。如果MSVC拒绝使用没有实例化的模板
template <typename T>
using ConstRestrict = T const __restrict;
MSVC发出错误:
error C2219: syntax error: type qualifier must be after '*'
但是,下面的代码编译罚款与MSVC:
using ConstRestrictInt = ConstRestrict<int*>;
这是一个编译器错误?标准对此有何评论?
请提供[mcve],不要输入错别字。 **究竟**编译和不?两个陈述在一起?除了?故意你放弃了这个“特意”吗? – Yakk
不是。这是最小的完整和可验证的例子... https://godbolt.org/g/pqrJFr –