| 1 |
// PR c++/63485 |
| 2 |
|
| 3 |
template <typename C> struct A |
| 4 |
{ |
| 5 |
typedef C type; |
| 6 |
}; |
| 7 |
template <class> class B |
| 8 |
{ |
| 9 |
}; |
| 10 |
template <class Range> void as_literal (Range &); |
| 11 |
template <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 |
}; |
| 22 |
template <typename> struct date_time_format_parser_callback : C<wchar_t> |
| 23 |
{ |
| 24 |
}; |
| 25 |
template <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 |
return char_type(); |
| 34 |
} |
| 35 |
}; |
| 36 |
struct F |
| 37 |
{ |
| 38 |
typedef date_time_format_parser_callback<wchar_t> callback_type; |
| 39 |
typedef wchar_t char_type; |
| 40 |
}; |
| 41 |
template <typename CharT, typename ParserT, typename CallbackT> |
| 42 |
void |
| 43 |
parse_format (CharT *p1, ParserT p2, CallbackT p3) |
| 44 |
{ |
| 45 |
CharT p = p2.parse (&p, p1, p3); |
| 46 |
} |
| 47 |
template <typename CharT> |
| 48 |
void |
| 49 |
parse_date_time_format (const CharT *, const CharT *p2, |
| 50 |
date_time_format_parser_callback<CharT> &p3) |
| 51 |
{ |
| 52 |
D<F> b; |
| 53 |
parse_format (p2, b, p3); |
| 54 |
} |
| 55 |
template void |
| 56 |
parse_date_time_format (const wchar_t *, const wchar_t *, |
| 57 |
date_time_format_parser_callback<wchar_t> &); |