https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71568

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-23
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |trippels at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 /tmp % cat tupl.ii
struct A {
  static constexpr int value = 0;
};
template <int> struct B { typedef int type; };
template <unsigned long, typename...> struct C;
template <unsigned long _Idx, typename _Head> struct C<_Idx, _Head> : _Head {};
template <typename... _Elements> class F : C<0, _Elements...> {};
template <typename> using void_t = void;
template <class, class = void> struct G : A {};
template <typename T> struct G<T, void_t<decltype(&T::nlog_custom)>> {};
template <typename Head> typename B<G<Head>::value>::type write(Head);
struct D {
  void nlog_custom();
};
void test() {
  F<D> __trans_tmp_2;
  write(__trans_tmp_2);
}

markus@x4 /tmp % clang++ -c tupl.ii
markus@x4 /tmp % icpc -c tupl.ii
markus@x4 /tmp % g++ -c tupl.ii
tupl.ii: In instantiation of ‘struct G<F<D>, void>’:
tupl.ii:11:59:   required by substitution of ‘template<class Head> typename
B<G<Head>::value>::type write(Head) [with Head = F<D>]’
tupl.ii:17:22:   required from here
tupl.ii:10:51: error: ‘void D::nlog_custom()’ is inaccessible within this
context
 template <typename T> struct G<T, void_t<decltype(&T::nlog_custom)>> {};
                                                   ^~
tupl.ii:13:8: note: declared here
   void nlog_custom();
        ^~~~~~~~~~~
tupl.ii:10:51: error: ‘void D::nlog_custom()’ is inaccessible within this
context
 template <typename T> struct G<T, void_t<decltype(&T::nlog_custom)>> {};
                                                   ^~
tupl.ii:13:8: note: declared here
   void nlog_custom();
        ^~~~~~~~~~~
tupl.ii: In function ‘void test()’:
tupl.ii:17:22: error: no matching function for call to ‘write(F<D>&)’
   write(__trans_tmp_2);
                      ^
tupl.ii:11:59: note: candidate: template<class Head> typename
B<G<Head>::value>::type write(Head)
 template <typename Head> typename B<G<Head>::value>::type write(Head);
                                                           ^~~~~
tupl.ii:11:59: note:   substitution of deduced template arguments resulted in
errors seen above

Reply via email to