OSDN Git Service

cp/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / conv1.C
1 // { dg-do compile }
2
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 20 Apr 2003 <nathan@codesourcery.com>
5
6 // PR 10337, unneeded warning
7
8 class A {
9   public:
10   A() {}
11 };
12
13 class B : public A {
14   public:
15   B() {}
16   void operator=(const A& b) {}
17   void operator=(const B& b) {}
18 };
19
20 class C {
21   public:
22   C() {}
23   operator B &() { return _b; }
24   operator const B &() const { return _b; }
25   
26   B _b;
27 };
28
29 int main() {
30   B b;
31   C c;
32   b = c;
33 }