https://llvm.org/bugs/show_bug.cgi?id=27544
Bug ID: 27544 Summary: defined template friend is 'sometimes' not defined - std::experimental::any Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: C++11 Assignee: unassignedclangb...@nondot.org Reporter: eyen...@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 16276 --> https://llvm.org/bugs/attachment.cgi?id=16276&action=edit Minimal broken example Hello, Today I tried clang 3.7.1 and 3.9.0 (trunk) with the std::experimental::any implementation. I reduced the bug to the following (also attached): class foo { public: template <typename T> friend void gun(foo&) { } template <typename T> friend void gun2(foo&) { } }; // error: redefinition of 'gun' // template <typename T> // void gun(foo&) { // } // error: redefinition of 'gun2' // template <typename T> // void gun2(foo&) { // } template <typename T> void fun() noexcept { foo f; // no template named 'gun'; did you mean 'fun'? gun<T>(f); // error: no template named 'gun2'; did you mean 'gun'? // 'T' does not refer to a value gun2<T>(f); } int main(int, char const* []) { fun<void>(); return 0; } In the case of std::experimental::any fun is any_cast and gun is __any_cast. The headers of gcc 5.3.0 were used -- gcc has no problems with the code above. I hope I got all the information you'll need to figure out this strange bug. Thank you for your hard work! :) -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs