Lines Matching full:get

1 // RUN: %check_clang_tidy %s readability-redundant-smartptr-get %t
11 T* get() const;
19 T* get() const;
49 Bar* get();
53 int* get();
59 Bar* get();
62 Bar* get();
68 int* get();
70 T* get();
78 BarPtr().get()->Do();
79 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: redundant get() call on smart pointer [readability-redundant-smartptr-get]
80 // CHECK-MESSAGES: BarPtr().get()->Do();
83 u.get()->ConstDo();
84 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: redundant get() call
85 // CHECK-MESSAGES: u.get()->ConstDo();
88 Bar& b = *BarPtr().get();
89 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: redundant get() call
90 // CHECK-MESSAGES: Bar& b = *BarPtr().get();
93 Bar& b2 = *std::unique_ptr<Bar>().get();
94 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: redundant get() call
95 // CHECK-MESSAGES: Bar& b2 = *std::unique_ptr<Bar>().get();
98 (*BarPtr().get()).ConstDo();
99 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant get() call
100 // CHECK-MESSAGES: (*BarPtr().get()).ConstDo();
103 (*std::unique_ptr<Bar>().get()).ConstDo();
104 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant get() call
105 // CHECK-MESSAGES: (*std::unique_ptr<Bar>().get()).ConstDo();
109 (*up->get()).Do();
110 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant get() call
111 // CHECK-MESSAGES: (*up->get()).Do();
115 int i = *ip.get();
116 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: redundant get() call
117 // CHECK-MESSAGES: int i = *ip.get();
121 i = *ip2.get();
122 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
123 // CHECK-MESSAGES: i = *ip2.get();
128 bool bb = uu.get() == nullptr;
129 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: redundant get() call
130 // CHECK-MESSAGES: uu.get() == nullptr;
133 if (up->get());
134 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: redundant get() call
135 // CHECK-MESSAGES: if (up->get());
137 if ((uu.get()));
138 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
139 // CHECK-MESSAGES: if ((uu.get()));
141 bb = !ss->get();
142 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: redundant get() call
143 // CHECK-MESSAGES: bb = !ss->get();
145 bb = u.get() ? true : false;
146 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
147 // CHECK-MESSAGES: bb = u.get() ? true : false;
150 bb = nullptr != ss->get();
151 // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: redundant get() call
152 // CHECK-MESSAGES: nullptr != ss->get();
155 i = *PointerWithOverloadedGet().get();
156 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
157 // CHECK-MESSAGES: i = *PointerWithOverloadedGet().get();
160 bb = std::unique_ptr<int>().get() == NULL;
161 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
162 // CHECK-MESSAGES: bb = std::unique_ptr<int>().get() == NULL;
164 bb = ss->get() == NULL;
165 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
166 // CHECK-MESSAGES: bb = ss->get() == NULL;
170 if (x.get() == nullptr);
171 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: redundant get() call
172 // CHECK-MESSAGES: if (x.get() == nullptr);
174 if (nullptr == y.get());
175 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: redundant get() call
176 // CHECK-MESSAGES: if (nullptr == y.get());
178 if (x.get() == NULL);
179 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: redundant get() call
180 // CHECK-MESSAGES: if (x.get() == NULL);
182 if (NULL == x.get());
183 // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: redundant get() call
184 // CHECK-MESSAGES: if (NULL == x.get());
190 T().get()->Do();
196 up.get()->Do();
197 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: redundant get() call
212 m_up.get()->Do();
213 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant get() call
215 m_bp.get()->Do();
216 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant get() call
224 #define MACRO(p) p.get()
228 int* get();
230 return &*this->get();
233 return *get();
237 long l = *PointerWithOverloadedGet().get<long>();
240 u->get()->Do();
242 Fail1().get()->Do();
243 Fail2().get()->Do();
244 const Bar& b = *Fail1().get();
245 (*Fail2().get()).Do();
248 bool bb = ip.get() == nullptr;
249 bb = !ip.get();
250 bb = ip.get() ? true : false;
260 f(*i->get());
261 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
273 Inner* get() { return &inner; }
281 f(*(*i).get()->get()->getValue());
282 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: redundant get() call
283 // CHECK-FIXES: f(**i->get()->getValue());