Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.other / overcnv2.C
blobef9c1f7823b8181044627c666e29a9955950c578
1 // { dg-do assemble  }
2 // { dg-options "-Wconversion" } 
3 // Test that we resolve this case as mandated by the standard, but also
4 // warn about it.  We choose op char* not because it is a member of B --
5 // the standard says that all conversion ops are treated as coming from
6 // the type of the argument -- but because it is non-const.
8 struct A  {
9   operator const char *() const { return ""; }
12 struct B : public A {
13   operator char *() { return 0; }
16 int main()
18   B b;
19   if ((const char *)b != 0)  // { dg-warning "" } surprising overload resolution
20     return 1;
21   if ((const char *)(const B)b == 0)
22     return 2;
23   if ((const char *)(const B &)b == 0)
24     return 3;