Lines Matching +full:has +full:- +full:value
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
26 int &i; // expected-error {{union member 'i' has reference type 'int &'}}
70 bool has; member
71 union { T value; }; member
73 optional() : has(false) {} in optional()
75 optional(U &&...u) : has(true), value(forward<U>(u)...) {} in optional()
77 optional(const optional &o) : has(o.has) { in optional()
78 if (has) new (&value) T(o.value); in optional()
80 optional(optional &&o) : has(o.has) { in optional()
81 if (has) new (&value) T(move(o.value)); in optional()
85 if (has) { in operator =()
86 if (o.has) in operator =()
87 value = o.value; in operator =()
89 value.~T(); in operator =()
90 } else if (o.has) { in operator =()
91 new (&value) T(o.value); in operator =()
93 has = o.has; in operator =()
96 if (has) { in operator =()
97 if (o.has) in operator =()
98 value = move(o.value); in operator =()
100 value.~T(); in operator =()
101 } else if (o.has) { in operator =()
102 new (&value) T(move(o.value)); in operator =()
104 has = o.has; in operator =()
108 if (has) in ~optional()
109 value.~T(); in ~optional()
112 explicit operator bool() const { return has; } in operator bool()
113 T &operator*() const { return value; } in operator *()
139 …struct { // expected-note {{default constructor of 'Test2<pr16061::X>' is implicitly deleted beca…
145 …Test2<X> t2x; // expected-error {{call to implicitly-deleted default constructor of 'Test2<pr1606…