1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s
3 namespace implicit_constructor
{
10 // Warning is in a weird position because the body of the constructor is
11 // missing. Specify which field is being assigned.
12 class C
{ // expected-warning{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
13 // expected-note@-1{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
23 C
c2(c1
); // expected-note{{Calling implicit copy constructor for 'C'}}
25 } // end namespace implicit_constructor
28 namespace explicit_constructor
{
34 // It is not necessary to specify which field is being assigned to.
37 y(c
.y
) // expected-warning{{Assigned value is garbage or undefined}}
38 // expected-note@-1{{Assigned value is garbage or undefined}}
44 C
c2(c1
); // expected-note{{Calling copy constructor for 'C'}}
46 } // end namespace explicit_constructor
49 namespace base_class_constructor
{
56 class C
{ // expected-warning{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
57 // expected-note@-1{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
72 D
d2(d1
); // expected-note {{Calling implicit copy constructor for 'D'}}
73 // expected-note@-1{{Calling implicit copy constructor for 'C'}}
75 } // end namespace base_class_constructor