blob: 976879ecd0ae2a7d41cafb45e553e2324d132e5c [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
2
3enum E2 { };
4
5struct A {
6 operator E2&(); // expected-note 3 {{candidate function}}
7};
8
9struct B {
10 operator E2&(); // expected-note 3 {{candidate function}}
11};
12
13struct C : B, A {
14};
15
16void test(C c) {
17 const E2 &e2 = c; // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}}
18}
19
20void foo(const E2 &);
21
22const E2 & re(C c) {
23 foo(c); // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}}
24
25 return c; // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}}
26}
27
28