https://llvm.org/bugs/show_bug.cgi?id=27225
Bug ID: 27225 Summary: accessing private field from public typedef is an error Product: clang Version: 3.8 Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: C++14 Assignee: unassignedclangb...@nondot.org Reporter: tower...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified The following code doesn't compiles in clang: http://coliru.stacked-crooked.com/a/1c88b33600d369f6 template<class R, class T1, class T2 = void> class GenericArity { std::integral_constant<int, 1> static get(function<R(T1)>){ return {}; } std::integral_constant<int, 2> static get(function<R(T1, T2)>){ return {}; } public: template<class Fn> using Arity = decltype(get(declval<Fn>())); template<class Fn> auto static arity(Fn&&){ return Arity<Fn>{}; } }; With the following errors: main.cpp:17:28: error: 'get' is a private member of 'GenericArity<void, std::__cxx11::basic_string<char>, int>' using Arity = decltype(get(declval<Fn>())); ^~~ main.cpp:46:60: note: in instantiation of template type alias 'Arity' requested here using Arity = GenericArity<void, string, int>::Arity<Fn>; ^ main.cpp:13:43: note: implicitly declared private here std::integral_constant<int, 2> static get(function<R(T1, T2)>){ return {}; } ^ 1 error generated. P.S. related to https://llvm.org/bugs/show_bug.cgi?id=25334 -- 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