Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ clang-4.0.0中的一个bug?_C++_Templates_C++17_Clang++_Auto - Fatal编程技术网

C++ 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&

似乎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&&);
    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