C++ clang-4.0.0中的一个bug?
似乎clang-4.0.0的实现中有一个bug。问题是:C++ clang-4.0.0中的一个bug?,c++,templates,c++17,clang++,auto,C++,Templates,C++17,Clang++,Auto,似乎clang-4.0.0的实现中有一个bug。问题是: // file main.cpp template < int, typename RR > void f1(RR&&) { } template < auto, typename RR > void f2(RR&&) { } class Class { template < int, typename RR > friend void f1(RR&
// file main.cpp
template < int, typename RR > void f1(RR&&) { }
template < auto, typename RR > void f2(RR&&) { }
class Class
{
template < int, typename RR > friend void f1(RR&&);
template < auto, typename RR > friend void f2(RR&&);
};
template < typename >
class ClassT
{
template < int, typename RR > friend void f1(RR&&);
template < auto, typename RR > friend void f2(RR&&);
};
int main()
{
f1<0>(0);
f1<0>(Class{});
f1<0>(ClassT<int>{});
f2<0>(0);
f2<0>(Class{});
f2<0>(ClassT<int>{}); // FAILS ?!
return 0;
}
这真的是一个错误还是我出了什么问题
我正在使用clang++-std=c++1zmain.cpp进行编译,其中clang++--version
给出了
clang version 4.0.0 (trunk 284635) (llvm/trunk 284639)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
缺陷很明显,声明匹配代码并没有更新为将这两个声明视为相同的函数template.Bug。很明显,声明匹配代码并没有更新为将这两个声明视为同一个函数模板。
clang version 4.0.0 (trunk 284635) (llvm/trunk 284639)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin