Lines Matching defs:Obj
127 void PositiveMethodCallConstReferenceParam(const ExpensiveToCopyType &Obj) {
128 const auto AutoAssigned = Obj.reference();
130 // CHECK-FIXES: const auto& AutoAssigned = Obj.reference();
133 const auto AutoCopyConstructed(Obj.reference());
135 // CHECK-FIXES: const auto& AutoCopyConstructed(Obj.reference());
138 const ExpensiveToCopyType VarAssigned = Obj.reference();
140 // CHECK-FIXES: const ExpensiveToCopyType& VarAssigned = Obj.reference();
143 const ExpensiveToCopyType VarCopyConstructed(Obj.reference());
145 // CHECK-FIXES: const ExpensiveToCopyType& VarCopyConstructed(Obj.reference());
149 void PositiveMethodCallConstParam(const ExpensiveToCopyType Obj) {
150 const auto AutoAssigned = Obj.reference();
152 // CHECK-FIXES: const auto& AutoAssigned = Obj.reference();
155 const auto AutoCopyConstructed(Obj.reference());
157 // CHECK-FIXES: const auto& AutoCopyConstructed(Obj.reference());
160 const ExpensiveToCopyType VarAssigned = Obj.reference();
162 // CHECK-FIXES: const ExpensiveToCopyType& VarAssigned = Obj.reference();
165 const ExpensiveToCopyType VarCopyConstructed(Obj.reference());
167 // CHECK-FIXES: const ExpensiveToCopyType& VarCopyConstructed(Obj.reference());
171 void PositiveMethodCallConstPointerParam(const ExpensiveToCopyType *const Obj) {
172 const auto AutoAssigned = Obj->reference();
174 // CHECK-FIXES: const auto& AutoAssigned = Obj->reference();
177 const auto AutoCopyConstructed(Obj->reference());
179 // CHECK-FIXES: const auto& AutoCopyConstructed(Obj->reference());
182 const ExpensiveToCopyType VarAssigned = Obj->reference();
184 // CHECK-FIXES: const ExpensiveToCopyType& VarAssigned = Obj->reference();
187 const ExpensiveToCopyType VarCopyConstructed(Obj->reference());
189 // CHECK-FIXES: const ExpensiveToCopyType& VarCopyConstructed(Obj->reference());
304 const ExpensiveToCopyType Obj;
305 const auto UnnecessaryCopy = Obj.reference();
307 // CHECK-FIXES: const auto& UnnecessaryCopy = Obj.reference();
312 const ExpensiveToCopyType Obj;
313 const ExpensiveToCopyType &ConstReference = Obj.reference();
321 const ExpensiveToCopyType Obj;
322 const ExpensiveToCopyType *const ConstPointer = &Obj;
336 void NegativeStaticLocalVar(const ExpensiveToCopyType &Obj) {
337 static const auto StaticVar = Obj.reference();
362 void positiveNonConstVarInCodeBlock(const ExpensiveToCopyType &Obj) {
364 auto Assigned = Obj.reference();
366 // CHECK-FIXES: const auto& Assigned = Obj.reference();
373 void positiveNonConstVarInCodeBlockWithAlias(const ExpensiveToCopyType &Obj) {
375 const ExpensiveToCopyType Assigned = Obj.referenceWithAlias();
377 // CHECK-FIXES: const ExpensiveToCopyType& Assigned = Obj.referenceWithAlias();
382 void negativeNonConstVarWithNonConstUse(const ExpensiveToCopyType &Obj) {
384 auto NonConstInvoked = Obj.reference();
385 // CHECK-FIXES: auto NonConstInvoked = Obj.reference();
389 auto Reassigned = Obj.reference();
390 // CHECK-FIXES: auto Reassigned = Obj.reference();
394 auto MutatedByReference = Obj.reference();
395 // CHECK-FIXES: auto MutatedByReference = Obj.reference();
399 auto MutatedByPointer = Obj.reference();
400 // CHECK-FIXES: auto MutatedByPointer = Obj.reference();
405 void PositiveMethodCallNonConstRefNotModified(ExpensiveToCopyType &Obj) {
406 const auto AutoAssigned = Obj.reference();
408 // CHECK-FIXES: const auto& AutoAssigned = Obj.reference();
412 void NegativeMethodCallNonConstRefIsModified(ExpensiveToCopyType &Obj) {
413 const auto AutoAssigned = Obj.reference();
414 const auto AutoCopyConstructed(Obj.reference());
415 const ExpensiveToCopyType VarAssigned = Obj.reference();
416 const ExpensiveToCopyType VarCopyConstructed(Obj.reference());
417 mutate(&Obj);
420 void PositiveMethodCallNonConstNotModified(ExpensiveToCopyType Obj) {
421 const auto AutoAssigned = Obj.reference();
423 // CHECK-FIXES: const auto& AutoAssigned = Obj.reference();
427 void NegativeMethodCallNonConstValueArgumentIsModified(ExpensiveToCopyType Obj) {
428 Obj.nonConstMethod();
429 const auto AutoAssigned = Obj.reference();
432 void PositiveMethodCallNonConstPointerNotModified(ExpensiveToCopyType *const Obj) {
433 const auto AutoAssigned = Obj->reference();
435 // CHECK-FIXES: const auto& AutoAssigned = Obj->reference();
436 Obj->constMethod();
440 void NegativeMethodCallNonConstPointerIsModified(ExpensiveToCopyType *const Obj) {
441 const auto AutoAssigned = Obj->reference();
442 const auto AutoCopyConstructed(Obj->reference());
443 const ExpensiveToCopyType VarAssigned = Obj->reference();
444 const ExpensiveToCopyType VarCopyConstructed(Obj->reference());
445 mutate(Obj);
457 ExpensiveToCopyType Obj;
458 const auto AutoAssigned = Obj.reference();
459 Obj = AutoAssigned;
463 NegativeConstructor(const ExpensiveToCopyType &Obj) : Obj(Obj) {}
464 ExpensiveToCopyType Obj;
479 void PositiveMacroArgument(const ExpensiveToCopyType &Obj) {
480 UNNECESSARY_COPY_INIT_IN_MACRO_ARGUMENT(auto CopyInMacroArg = Obj.reference());
483 // CHECK-FIXES: auto CopyInMacroArg = Obj.reference()