]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaCXX/ref-init-ambiguous.cpp
Update clang to r86025.
[FreeBSD/FreeBSD.git] / test / SemaCXX / ref-init-ambiguous.cpp
1 // RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
2
3 enum E2 { };
4
5 struct A { 
6   operator E2&(); // expected-note 3 {{candidate function}}
7 };
8
9 struct B { 
10   operator E2&(); // expected-note 3 {{candidate function}}
11 };
12
13 struct C : B, A { 
14 };
15
16 void 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
20 void foo(const E2 &);
21
22 const 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