OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rv7n.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// I, Howard Hinnant, hereby place this code in the public domain.
2
 
3
// Test overload resolution among reference types
4
 
5
// { dg-do compile }
6
// { dg-options "-std=c++0x" }
7
 
8
template  struct sa;
9
template <> struct sa {};
10
 
11
struct one   {char x[1];};
12
struct two   {char x[2];};
13
struct three {char x[3];};
14
struct four  {char x[4];};
15
struct five  {char x[5];};
16
struct six   {char x[6];};
17
struct seven {char x[7];};
18
struct eight {char x[8];};
19
 
20
struct A
21
{
22
    A();
23
    A(const volatile A&&);
24
};
25
 
26
               A    source();
27
const          A  c_source();
28
      volatile A  v_source();
29
const volatile A cv_source();
30
 
31
// 7 at a time
32
 
33
one   sink_7_1234567(               A&);  // { dg-message "one sink_7_1234567|no known conversion" }
34
two   sink_7_1234567(const          A&);  // { dg-message "note" }
35
three sink_7_1234567(volatile       A&);  // { dg-message "note" }
36
four  sink_7_1234567(const volatile A&);  // { dg-message "note" }
37
five  sink_7_1234567(               A&&);  // { dg-message "note" }
38
six   sink_7_1234567(const          A&&);  // { dg-message "note" }
39
seven sink_7_1234567(volatile       A&&);  // { dg-message "note" }
40
 
41
int test7_1234567()
42
{
43
                   A a;
44
    const          A ca = a; // { dg-error "deleted" }
45
          volatile A va;
46
    const volatile A cva = a; // { dg-error "deleted" }
47
    sink_7_1234567(cv_source());  // { dg-error "no match" }
48
    // { dg-message "candidate" "candidate note" { target *-*-* } 47 }
49
    return 0;
50
}
51
 
52
one   sink_7_1235678(               A&);
53
two   sink_7_1235678(const          A&);
54
three sink_7_1235678(volatile       A&);
55
five  sink_7_1235678(               A&&);
56
six   sink_7_1235678(const          A&&);
57
seven sink_7_1235678(volatile       A&&);
58
eight sink_7_1235678(const volatile A&&); // { dg-message "" }
59
 
60
int test7_1235678()
61
{
62
                   A a;
63
    const          A ca = a; // { dg-error "deleted" }
64
          volatile A va;
65
    const volatile A cva = a; // { dg-error "deleted" }
66
    sink_7_1235678(cva);        // { dg-error "lvalue" }
67
    return 0;
68
}
69
 
70
two   sink_7_2345678(const          A&);  // { dg-message "note" }
71
three sink_7_2345678(volatile       A&);  // { dg-message "note" }
72
four  sink_7_2345678(const volatile A&);  // { dg-message "note" }
73
five  sink_7_2345678(               A&&);  // { dg-message "note" }
74
six   sink_7_2345678(const          A&&);  // { dg-message "note" }
75
seven sink_7_2345678(volatile       A&&);  // { dg-message "note" }
76
eight sink_7_2345678(const volatile A&&);  // { dg-message "note" }
77
 
78
int test7_2345678()
79
{
80
                   A a;
81
    const          A ca = a; // { dg-error "deleted" }
82
          volatile A va;
83
    const volatile A cva = a; // { dg-error "deleted" }
84
    sink_7_2345678(a);  // { dg-error "ambiguous" }
85
    // { dg-message "candidate" "candidate note" { target *-*-* } 84 }
86
    return 0;
87
}
88
 
89
one   sink_7_1234678(               A&);
90
two   sink_7_1234678(const          A&);  // { dg-message "note" }
91
three sink_7_1234678(volatile       A&);
92
four  sink_7_1234678(const volatile A&);
93
six   sink_7_1234678(const          A&&);  // { dg-message "note" }
94
seven sink_7_1234678(volatile       A&&);  // { dg-message "note" }
95
eight sink_7_1234678(const volatile A&&);  // { dg-message "note" }
96
 
97
int test7_1234678()
98
{
99
                   A a;
100
    const          A ca = a; // { dg-error "deleted" }
101
          volatile A va;
102
    const volatile A cva = a; // { dg-error "deleted" }
103
    sink_7_1234678(source());  // { dg-error "ambiguous" }
104
    // { dg-message "candidate" "candidate note" { target *-*-* } 103 }
105
    return 0;
106
}
107
 
108
int main()
109
{
110
    return test7_2345678() + test7_1234678();
111
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.