Debian Codegraph @

gcc/testsuite/g++.dg/template/pr51385.C

raw
1 // PR c++/51385
2
3 template <__SIZE_TYPE__ N> struct NTmpl;
4 template <typename T, typename U, typename V = NTmpl<sizeof(T *)> >
5 struct PtrConvs {
6 enum { bad = 1 };
7 };
8
9 template <typename Target, typename Source>
10 struct PtrConvs<Target, Source, NTmpl<sizeof (*(Target **)0 = (Source *)0)> >;
11
12 template<typename T> struct test { static const bool value = true; };
13 template<> struct test<short> { static const bool value = false; };
14
15 template <typename T>
16 struct FussyTemplate
17 {
18 int sa[test<T>::value ? 1 : -1];
19 };
20
21 struct B { };
22
23 typedef char chk[1];
24 typedef char chk[PtrConvs<FussyTemplate<short>, B>::bad];