1// PR c++/63485
2
3template <typename C> struct A
4{
5  typedef C type;
6};
7template <class> class B
8{
9};
10template <class Range> void as_literal (Range &);
11template <typename> struct C
12{
13  typedef wchar_t char_type;
14  const char_type on_full_year_placeholder[3];
15  void
16  on_extended_iso_date ()
17  {
18    B<A<wchar_t const[3]>::type> a;
19    as_literal (on_full_year_placeholder);
20  }
21};
22template <typename> struct date_time_format_parser_callback : C<wchar_t>
23{
24};
25template <typename BaseT> struct D
26{
27  typedef typename BaseT::char_type char_type;
28  char_type
29  parse (const char_type *, const char_type *,
30         typename BaseT::callback_type p3)
31  {
32    p3.on_extended_iso_date ();
33  }
34};
35struct F
36{
37  typedef date_time_format_parser_callback<wchar_t> callback_type;
38  typedef wchar_t char_type;
39};
40template <typename CharT, typename ParserT, typename CallbackT>
41void
42parse_format (CharT *p1, ParserT p2, CallbackT p3)
43{
44  CharT p = p2.parse (&p, p1, p3);
45}
46template <typename CharT>
47void
48parse_date_time_format (const CharT *, const CharT *p2,
49                        date_time_format_parser_callback<CharT> &p3)
50{
51  D<F> b;
52  parse_format (p2, b, p3);
53}
54template void
55parse_date_time_format (const wchar_t *, const wchar_t *,
56                        date_time_format_parser_callback<wchar_t> &);
57