Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.jason / bool.C
blob5e897bc54ac0c265ff39058819af362dce8947a3
1 // { dg-do assemble  }
2 // Testcase for uses of bool.
4 int i,j,k;
6 /* Check that types of certain expressions are bool.  */
7 void f ()
9   i ? j == k : true;
10   i ? j < k : true;
11   i ? j && k : true;
14 /* Check that g++ can find a conversion to bool when one exists.  */
15 struct A { operator char * (); } a;
16 struct B { operator int (); } b;
17 struct C { operator float (); } c;
18 struct D { operator bool (); } d;
19 struct E { operator int E::* (); } e;
21 void g ()
23   a || true;
24   b || true;
25   c || true;                    // { dg-bogus "" } 
26   d || true;
27   e || true;
30 /* Check for support in templates.  */
31 template <class T> struct F { };
32 template class F<bool>;
34 template <class T> void f (T, bool) { }
35 template void f (bool, bool);
37 /* Special cases.  */
38 void h ()
40   /* Used to cause infinite recursion.  */
41   i&1 || true;
42   /* Should find conversion path to int.  */
43   d == true;
46 bool boo = -1;