1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,optin.cplusplus.UninitializedObject \
2 // RUN: -analyzer-config optin.cplusplus.UninitializedObject:Pedantic=true -DPEDANTIC \
3 // RUN: -analyzer-config optin.cplusplus.UninitializedObject:CheckPointeeInitialization=true \
4 // RUN: -std=c++11 -verify %s
6 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,optin.cplusplus.UninitializedObject \
7 // RUN: -analyzer-config optin.cplusplus.UninitializedObject:CheckPointeeInitialization=true \
8 // RUN: -std=c++11 -verify %s
10 //===----------------------------------------------------------------------===//
11 // Concrete location tests.
12 //===----------------------------------------------------------------------===//
14 struct ConcreteIntLocTest
{
17 ConcreteIntLocTest() : ptr(reinterpret_cast<int *>(0xDEADBEEF)) {}
20 void fConcreteIntLocTest() {
24 //===----------------------------------------------------------------------===//
25 // nonloc::LocAsInteger tests.
26 //===----------------------------------------------------------------------===//
28 using intptr_t = unsigned long long;
30 struct LocAsIntegerTest
{
31 intptr_t ptr
; // expected-note{{uninitialized pointee 'reinterpret_cast<char *>(this->ptr)'}}
32 int dontGetFilteredByNonPedanticMode
= 0;
34 LocAsIntegerTest(void *ptr
) : ptr(reinterpret_cast<intptr_t>(ptr
)) {} // expected-warning{{1 uninitialized field}}
37 void fLocAsIntegerTest() {
39 LocAsIntegerTest
t(&c
);
42 //===----------------------------------------------------------------------===//
43 // Null pointer tests.
44 //===----------------------------------------------------------------------===//
52 float *fptr
= nullptr;
57 NullPtrTest() : ptr(nullptr), recPtr(nullptr) {
66 //===----------------------------------------------------------------------===//
68 //===----------------------------------------------------------------------===//
70 struct UntypedAllocaTest
{
72 int dontGetFilteredByNonPedanticMode
= 0;
74 // expected-warning-re@+3 {{Address of stack memory allocated by call to \
75 alloca() on line
{{[0-9]+}} is still referred to by a temporary object on the \
76 stack upon returning to the caller
. This will be a dangling reference
}}
77 UntypedAllocaTest() : allocaPtr(__builtin_alloca(sizeof(int))) {
82 void fUntypedAllocaTest() {
86 struct TypedAllocaTest1
{
87 int *allocaPtr
; // expected-note{{uninitialized pointee 'this->allocaPtr'}}
88 int dontGetFilteredByNonPedanticMode
= 0;
90 TypedAllocaTest1() // expected-warning{{1 uninitialized field}}
91 : allocaPtr(static_cast<int *>(__builtin_alloca(sizeof(int)))) {}
92 // expected-warning-re@-2 {{Address of stack memory allocated by call to \
93 alloca() on line
{{[0-9]+}} is still referred to by a temporary object on the \
94 stack upon returning to the caller
. This will be a dangling reference
}}
97 void fTypedAllocaTest1() {
101 struct TypedAllocaTest2
{
103 int dontGetFilteredByNonPedanticMode
= 0;
105 // expected-warning-re@+5 {{Address of stack memory allocated by call to \
106 alloca() on line
{{[0-9]+}} is still referred to by a temporary object on the \
107 stack upon returning to the caller
. This will be a dangling reference
}}
109 : allocaPtr(static_cast<int *>(__builtin_alloca(sizeof(int)))) {
115 void fTypedAllocaTest2() {
119 //===----------------------------------------------------------------------===//
120 // Heap pointer tests.
121 //===----------------------------------------------------------------------===//
123 class HeapPointerTest1
{
125 // TODO: we'd expect the note: {{uninitialized field 'this->recPtr->y'}}
127 // TODO: we'd expect the note: {{uninitialized field 'this->recPtr->y'}}
130 // TODO: we'd expect the note: {{uninitialized pointee 'this->fptr'}}
131 float *fptr
= new float; // no-note
132 // TODO: we'd expect the note: {{uninitialized pointee 'this->ptr'}}
137 // TODO: we'd expect the warning: {{4 uninitialized fields}}
138 HeapPointerTest1() : ptr(new int), recPtr(new RecordType
) { // no-note
142 void fHeapPointerTest1() {
146 class HeapPointerTest2
{
152 float *fptr
= new float(); // initializes to 0
157 HeapPointerTest2() : ptr(new int{25}), recPtr(new RecordType
{26, 27}) {
162 void fHeapPointerTest2() {
166 //===----------------------------------------------------------------------===//
167 // Stack pointer tests.
168 //===----------------------------------------------------------------------===//
170 class StackPointerTest1
{
182 StackPointerTest1(int *_ptr
, StackPointerTest1::RecordType
*_recPtr
) : ptr(_ptr
), recPtr(_recPtr
) {
187 void fStackPointerTest1() {
189 StackPointerTest1::RecordType ok_rec
{29, 30};
190 StackPointerTest1(&ok_a
, &ok_rec
); // 'a', 'rec.x', 'rec.y' uninitialized
194 class StackPointerTest2
{
197 int x
; // expected-note{{uninitialized field 'this->recPtr->x'}}
198 int y
; // expected-note{{uninitialized field 'this->recPtr->y'}}
202 int *ptr
; // expected-note{{uninitialized pointee 'this->ptr'}}
206 StackPointerTest2(int *_ptr
, RecordType
*_recPtr
) : ptr(_ptr
), recPtr(_recPtr
) { // expected-warning{{3 uninitialized fields}}
210 void fStackPointerTest2() {
212 StackPointerTest2::RecordType rec
;
213 StackPointerTest2(&a
, &rec
); // 'a', 'rec.x', 'rec.y' uninitialized
216 class StackPointerTest2
{
228 StackPointerTest2(int *_ptr
, RecordType
*_recPtr
) : ptr(_ptr
), recPtr(_recPtr
) {
232 void fStackPointerTest2() {
234 StackPointerTest2::RecordType rec
;
235 StackPointerTest2(&a
, &rec
); // 'a', 'rec.x', 'rec.y' uninitialized
239 class UninitPointerTest
{
245 int *ptr
; // expected-note{{uninitialized pointer 'this->ptr'}}
249 UninitPointerTest() : recPtr(new RecordType
{13, 13}) { // expected-warning{{1 uninitialized field}}
253 void fUninitPointerTest() {
257 struct CharPointerTest
{
259 int dontGetFilteredByNonPedanticMode
= 0;
261 CharPointerTest() : str("") {}
264 void fCharPointerTest() {
268 struct VectorSizePointer
{
269 VectorSizePointer() {} // expected-warning{{1 uninitialized field}}
270 __attribute__((__vector_size__(8))) int *x
; // expected-note{{uninitialized pointer 'this->x'}}
271 int dontGetFilteredByNonPedanticMode
= 0;
274 void __vector_size__PointerTest() {
278 struct VectorSizePointee
{
279 using MyVectorType
= __attribute__((__vector_size__(8))) int;
282 VectorSizePointee(decltype(x
) x
) : x(x
) {}
285 void __vector_size__PointeeTest() {
286 VectorSizePointee::MyVectorType i
;
287 // TODO: Report v.x's pointee.
288 VectorSizePointee
v(&i
);
291 struct CyclicPointerTest1
{
292 int *ptr
; // expected-note{{object references itself 'this->ptr'}}
293 int dontGetFilteredByNonPedanticMode
= 0;
295 CyclicPointerTest1() : ptr(reinterpret_cast<int *>(&ptr
)) {} // expected-warning{{1 uninitialized field}}
298 void fCyclicPointerTest1() {
299 CyclicPointerTest1();
302 struct CyclicPointerTest2
{
303 int **pptr
; // expected-note{{object references itself 'this->pptr'}}
304 int dontGetFilteredByNonPedanticMode
= 0;
306 CyclicPointerTest2() : pptr(reinterpret_cast<int **>(&pptr
)) {} // expected-warning{{1 uninitialized field}}
309 void fCyclicPointerTest2() {
310 CyclicPointerTest2();
313 //===----------------------------------------------------------------------===//
314 // Void pointer tests.
315 //===----------------------------------------------------------------------===//
317 // Void pointer tests are mainly no-crash tests.
319 typedef __typeof(sizeof(int)) size_t;
321 void *calloc(size_t nmemb
, size_t size
);
324 class VoidPointerTest1
{
328 VoidPointerTest1(void *vptr
, char) : vptr(vptr
) {
333 void fVoidPointerTest1() {
334 void *vptr
= calloc(1, sizeof(int));
335 VoidPointerTest1(vptr
, char());
339 class VoidPointerTest2
{
343 VoidPointerTest2(void **vpptr
, char) : vpptr(vpptr
) {
348 void fVoidPointerTest2() {
349 void *vptr
= calloc(1, sizeof(int));
350 VoidPointerTest2(&vptr
, char());
354 class VoidPointerRRefTest1
{
355 void *&&vptrrref
; // expected-note {{here}}
358 // expected-warning@+3 {{Address of stack memory associated with local \
359 variable
'vptr' is still referred to by a temporary object on the stack \
360 upon returning to the caller
. This will be a dangling reference
}}
361 VoidPointerRRefTest1(void *vptr
, char) : vptrrref(static_cast<void *&&>(vptr
)) { // expected-warning {{binding reference member 'vptrrref' to stack allocated parameter 'vptr'}}
366 void fVoidPointerRRefTest1() {
367 void *vptr
= calloc(1, sizeof(int));
368 VoidPointerRRefTest1(vptr
, char());
372 class VoidPointerRRefTest2
{
373 void **&&vpptrrref
; // expected-note {{here}}
376 // expected-warning@+3 {{Address of stack memory associated with local \
377 variable
'vptr' is still referred to by a temporary object on the stack \
378 upon returning to the caller
. This will be a dangling reference
}}
379 VoidPointerRRefTest2(void **vptr
, char) : vpptrrref(static_cast<void **&&>(vptr
)) { // expected-warning {{binding reference member 'vpptrrref' to stack allocated parameter 'vptr'}}
384 void fVoidPointerRRefTest2() {
385 void *vptr
= calloc(1, sizeof(int));
386 VoidPointerRRefTest2(&vptr
, char());
390 class VoidPointerLRefTest
{
391 void *&vptrrref
; // expected-note {{here}}
394 // expected-warning@+3 {{Address of stack memory associated with local \
395 variable
'vptr' is still referred to by a temporary object on the stack \
396 upon returning to the caller
. This will be a dangling reference
}}
397 VoidPointerLRefTest(void *vptr
, char) : vptrrref(static_cast<void *&>(vptr
)) { // expected-warning {{binding reference member 'vptrrref' to stack allocated parameter 'vptr'}}
402 void fVoidPointerLRefTest() {
403 void *vptr
= calloc(1, sizeof(int));
404 VoidPointerLRefTest(vptr
, char());
408 struct CyclicVoidPointerTest
{
409 void *vptr
; // expected-note{{object references itself 'this->vptr'}}
410 int dontGetFilteredByNonPedanticMode
= 0;
412 CyclicVoidPointerTest() : vptr(&vptr
) {} // expected-warning{{1 uninitialized field}}
415 void fCyclicVoidPointerTest() {
416 CyclicVoidPointerTest();
419 struct IntDynTypedVoidPointerTest1
{
420 void *vptr
; // expected-note{{uninitialized pointee 'static_cast<int *>(this->vptr)'}}
421 int dontGetFilteredByNonPedanticMode
= 0;
423 IntDynTypedVoidPointerTest1(void *vptr
) : vptr(vptr
) {} // expected-warning{{1 uninitialized field}}
426 void fIntDynTypedVoidPointerTest1() {
428 IntDynTypedVoidPointerTest1
tmp(&a
);
431 struct RecordDynTypedVoidPointerTest
{
433 int x
; // expected-note{{uninitialized field 'static_cast<struct RecordDynTypedVoidPointerTest::RecordType *>(this->vptr)->x'}}
434 int y
; // expected-note{{uninitialized field 'static_cast<struct RecordDynTypedVoidPointerTest::RecordType *>(this->vptr)->y'}}
438 int dontGetFilteredByNonPedanticMode
= 0;
440 RecordDynTypedVoidPointerTest(void *vptr
) : vptr(vptr
) {} // expected-warning{{2 uninitialized fields}}
443 void fRecordDynTypedVoidPointerTest() {
444 RecordDynTypedVoidPointerTest::RecordType a
;
445 RecordDynTypedVoidPointerTest
tmp(&a
);
448 struct NestedNonVoidDynTypedVoidPointerTest
{
450 int x
; // expected-note{{uninitialized field 'static_cast<struct NestedNonVoidDynTypedVoidPointerTest::RecordType *>(this->vptr)->x'}}
451 int y
; // expected-note{{uninitialized field 'static_cast<struct NestedNonVoidDynTypedVoidPointerTest::RecordType *>(this->vptr)->y'}}
452 void *vptr
; // expected-note{{uninitialized pointee 'static_cast<char *>(static_cast<struct NestedNonVoidDynTypedVoidPointerTest::RecordType *>(this->vptr)->vptr)'}}
456 int dontGetFilteredByNonPedanticMode
= 0;
458 NestedNonVoidDynTypedVoidPointerTest(void *vptr
, void *c
) : vptr(vptr
) {
459 static_cast<RecordType
*>(vptr
)->vptr
= c
; // expected-warning{{3 uninitialized fields}}
463 void fNestedNonVoidDynTypedVoidPointerTest() {
464 NestedNonVoidDynTypedVoidPointerTest::RecordType a
;
466 NestedNonVoidDynTypedVoidPointerTest
tmp(&a
, &c
);
469 //===----------------------------------------------------------------------===//
470 // Multipointer tests.
471 //===----------------------------------------------------------------------===//
474 class MultiPointerTest1
{
482 RecordType
**mptr
; // expected-note{{uninitialized pointee 'this->mptr'}}
485 MultiPointerTest1(RecordType
**p
, int) : mptr(p
) { // expected-warning{{1 uninitialized field}}
489 void fMultiPointerTest1() {
490 MultiPointerTest1::RecordType
*p1
;
491 MultiPointerTest1::RecordType
**mptr
= &p1
;
492 MultiPointerTest1(mptr
, int()); // '*mptr' uninitialized
495 class MultiPointerTest1
{
506 MultiPointerTest1(RecordType
**p
, int) : mptr(p
) {}
509 void fMultiPointerTest1() {
510 MultiPointerTest1::RecordType
*p1
;
511 MultiPointerTest1::RecordType
**mptr
= &p1
;
512 MultiPointerTest1(mptr
, int()); // '*mptr' uninitialized
517 class MultiPointerTest2
{
520 int x
; // expected-note{{uninitialized field 'this->mptr->x'}}
521 int y
; // expected-note{{uninitialized field 'this->mptr->y'}}
528 MultiPointerTest2(RecordType
**p
, int) : mptr(p
) { // expected-warning{{2 uninitialized fields}}
532 void fMultiPointerTest2() {
533 MultiPointerTest2::RecordType i
;
534 MultiPointerTest2::RecordType
*p1
= &i
;
535 MultiPointerTest2::RecordType
**mptr
= &p1
;
536 MultiPointerTest2(mptr
, int()); // '**mptr' uninitialized
539 class MultiPointerTest2
{
550 MultiPointerTest2(RecordType
**p
, int) : mptr(p
) {
554 void fMultiPointerTest2() {
555 MultiPointerTest2::RecordType i
;
556 MultiPointerTest2::RecordType
*p1
= &i
;
557 MultiPointerTest2::RecordType
**mptr
= &p1
;
558 MultiPointerTest2(mptr
, int()); // '**mptr' uninitialized
562 class MultiPointerTest3
{
573 MultiPointerTest3(RecordType
**p
, int) : mptr(p
) {
578 void fMultiPointerTest3() {
579 MultiPointerTest3::RecordType i
{31, 32};
580 MultiPointerTest3::RecordType
*p1
= &i
;
581 MultiPointerTest3::RecordType
**mptr
= &p1
;
582 MultiPointerTest3(mptr
, int()); // '**mptr' uninitialized
585 //===----------------------------------------------------------------------===//
586 // Incomplete pointee tests.
587 //===----------------------------------------------------------------------===//
589 class IncompleteType
;
591 struct IncompletePointeeTypeTest
{
592 IncompleteType
*pImpl
; //no-crash
593 int dontGetFilteredByNonPedanticMode
= 0;
595 IncompletePointeeTypeTest(IncompleteType
*A
) : pImpl(A
) {}
598 void fIncompletePointeeTypeTest(void *ptr
) {
599 IncompletePointeeTypeTest(reinterpret_cast<IncompleteType
*>(ptr
));
602 //===----------------------------------------------------------------------===//
603 // Function pointer tests.
604 //===----------------------------------------------------------------------===//
606 struct FunctionPointerWithDifferentDynTypeTest
{
607 using Func1
= void *(*)();
608 using Func2
= int *(*)();
611 FunctionPointerWithDifferentDynTypeTest(Func2 f
) : f((Func1
)f
) {}
614 // Note that there isn't a function calling the constructor of
615 // FunctionPointerWithDifferentDynTypeTest, because a crash could only be
616 // reproduced without it.
618 //===----------------------------------------------------------------------===//
619 // Member pointer tests.
620 //===----------------------------------------------------------------------===//
622 struct UsefulFunctions
{
630 struct PointerToMemberFunctionTest1
{
631 void (UsefulFunctions::*f
)(void); // expected-note{{uninitialized field 'this->f'}}
632 PointerToMemberFunctionTest1() {}
635 void fPointerToMemberFunctionTest1() {
636 PointerToMemberFunctionTest1(); // expected-warning{{1 uninitialized field}}
639 struct PointerToMemberFunctionTest2
{
640 void (UsefulFunctions::*f
)(void);
641 PointerToMemberFunctionTest2(void (UsefulFunctions::*f
)(void)) : f(f
) {
646 void fPointerToMemberFunctionTest2() {
647 void (UsefulFunctions::*f
)(void) = &UsefulFunctions::print
;
648 PointerToMemberFunctionTest2
a(f
);
651 struct MultiPointerToMemberFunctionTest1
{
652 void (UsefulFunctions::**f
)(void); // expected-note{{uninitialized pointer 'this->f'}}
653 MultiPointerToMemberFunctionTest1() {}
656 void fMultiPointerToMemberFunctionTest1() {
657 MultiPointerToMemberFunctionTest1(); // expected-warning{{1 uninitialized field}}
660 struct MultiPointerToMemberFunctionTest2
{
661 void (UsefulFunctions::**f
)(void);
662 MultiPointerToMemberFunctionTest2(void (UsefulFunctions::**f
)(void)) : f(f
) {
667 void fMultiPointerToMemberFunctionTest2() {
668 void (UsefulFunctions::*f
)(void) = &UsefulFunctions::print
;
669 MultiPointerToMemberFunctionTest2
a(&f
);
672 struct PointerToMemberDataTest1
{
673 int UsefulFunctions::*d
; // expected-note{{uninitialized field 'this->d'}}
674 PointerToMemberDataTest1() {}
677 void fPointerToMemberDataTest1() {
678 PointerToMemberDataTest1(); // expected-warning{{1 uninitialized field}}
681 struct PointerToMemberDataTest2
{
682 int UsefulFunctions::*d
;
683 PointerToMemberDataTest2(int UsefulFunctions::*d
) : d(d
) {
688 void fPointerToMemberDataTest2() {
689 int UsefulFunctions::*d
= &UsefulFunctions::a
;
690 PointerToMemberDataTest2
a(d
);
693 struct MultiPointerToMemberDataTest1
{
694 int UsefulFunctions::**d
; // expected-note{{uninitialized pointer 'this->d'}}
695 MultiPointerToMemberDataTest1() {}
698 void fMultiPointerToMemberDataTest1() {
699 MultiPointerToMemberDataTest1(); // expected-warning{{1 uninitialized field}}
702 struct MultiPointerToMemberDataTest2
{
703 int UsefulFunctions::**d
;
704 MultiPointerToMemberDataTest2(int UsefulFunctions::**d
) : d(d
) {
709 void fMultiPointerToMemberDataTest2() {
710 int UsefulFunctions::*d
= &UsefulFunctions::a
;
711 MultiPointerToMemberDataTest2
a(&d
);
715 //===----------------------------------------------------------------------===//
716 // Tests for list-like records.
717 //===----------------------------------------------------------------------===//
722 Node
*next
= nullptr; // no crash
727 Node
*head
= nullptr;
742 Node
*next
= nullptr;
743 int i
; // expected-note{{uninitialized field 'this->head->i'}}
747 Node
*head
= nullptr;
750 ListTest2(Node
*node
, int) : head(node
) { // expected-warning{{1 uninitialized field}}
756 ListTest2(&n
, int());
762 Node
*next
= nullptr;
763 int i
; // expected-note{{uninitialized field 'this->head->i'}}
767 Node
*head
= nullptr;
770 CyclicList(Node
*node
, int) : head(node
) { // expected-warning{{1 uninitialized field}}
789 // note that n1.i is uninitialized
790 CyclicList(&n1
, int());
793 struct RingListTest
{
794 RingListTest
*next
; // no-crash
795 RingListTest() : next(this) {}
798 void fRingListTest() {
802 //===----------------------------------------------------------------------===//
803 // Tests for classes containing references.
804 //===----------------------------------------------------------------------===//
806 class ReferenceTest1
{
818 ReferenceTest1(RecordType
&lref
, RecordType
&rref
) : lref(lref
), rref(static_cast<RecordType
&&>(rref
)) {
823 void fReferenceTest1() {
824 ReferenceTest1::RecordType d
{33, 34};
825 ReferenceTest1(d
, d
);
829 class ReferenceTest2
{
832 int x
; // expected-note{{uninitialized field 'this->lref.x'}}
833 int y
; // expected-note{{uninitialized field 'this->lref.y'}}
841 ReferenceTest2(RecordType
&lref
, RecordType
&rref
)
842 : lref(lref
), rref(static_cast<RecordType
&&>(rref
)) { // expected-warning{{2 uninitialized fields}}
846 void fReferenceTest2() {
847 ReferenceTest2::RecordType c
;
848 ReferenceTest2(c
, c
);
851 class ReferenceTest2
{
863 ReferenceTest2(RecordType
&lref
, RecordType
&rref
)
864 : lref(lref
), rref(static_cast<RecordType
&&>(rref
)) {
868 void fReferenceTest2() {
869 ReferenceTest2::RecordType c
;
870 ReferenceTest2(c
, c
);
874 class ReferenceTest3
{
877 int x
; // expected-note{{uninitialized field 'this->lref.x'}}
878 int y
; // expected-note{{uninitialized field 'this->lref.y'}}
886 ReferenceTest3(RecordType
&lref
, RecordType
&rref
)
887 : lref(lref
), rref(static_cast<RecordType
&&>(rref
)) { // expected-warning{{2 uninitialized fields}}
891 void fReferenceTest3() {
892 ReferenceTest3::RecordType c
, d
{35, 36};
893 ReferenceTest3(c
, d
);
896 class ReferenceTest4
{
899 int x
; // expected-note{{uninitialized field 'this->rref.x'}}
900 int y
; // expected-note{{uninitialized field 'this->rref.y'}}
908 ReferenceTest4(RecordType
&lref
, RecordType
&rref
)
909 : lref(lref
), rref(static_cast<RecordType
&&>(rref
)) { // expected-warning{{2 uninitialized fields}}
913 void fReferenceTest5() {
914 ReferenceTest4::RecordType c
, d
{37, 38};
915 ReferenceTest4(d
, c
);
918 //===----------------------------------------------------------------------===//
919 // Tests for objects containing multiple references to the same object.
920 //===----------------------------------------------------------------------===//
922 struct IntMultipleReferenceToSameObjectTest
{
923 int *iptr
; // expected-note{{uninitialized pointee 'this->iptr'}}
924 int &iref
; // no-note, pointee of this->iref was already reported
926 int dontGetFilteredByNonPedanticMode
= 0;
928 IntMultipleReferenceToSameObjectTest(int *i
) : iptr(i
), iref(*i
) {} // expected-warning{{1 uninitialized field}}
931 void fIntMultipleReferenceToSameObjectTest() {
933 IntMultipleReferenceToSameObjectTest
Test(&a
);
936 struct IntReferenceWrapper1
{
937 int &a
; // expected-note{{uninitialized pointee 'this->a'}}
939 int dontGetFilteredByNonPedanticMode
= 0;
941 IntReferenceWrapper1(int &a
) : a(a
) {} // expected-warning{{1 uninitialized field}}
944 struct IntReferenceWrapper2
{
945 int &a
; // no-note, pointee of this->a was already reported
947 int dontGetFilteredByNonPedanticMode
= 0;
949 IntReferenceWrapper2(int &a
) : a(a
) {} // no-warning
952 void fMultipleObjectsReferencingTheSameObjectTest() {
955 IntReferenceWrapper1
T1(a
);
956 IntReferenceWrapper2
T2(a
);