// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
voidclang_analyzer_eval(bool);namespacebasic_tests{structA{int x;A(intx):x(x){}};structB:A{using A::A;};structC:B{using B::B;};voidtest_B(){
B b(1);clang_analyzer_eval(b.x==1);// expected-warning{{TRUE}}
}voidtest_C(){
C c(2);clang_analyzer_eval(c.x==2);// expected-warning{{TRUE}}
}}// namespace basic_tests
namespacearguments_with_constructors{structS{int x, y;S(intx,inty):x(x),y(y){}~S(){}};structA{S s;int z;A(S s,intz):s(s),z(z){}};structB:A{using A::A;};voidtest_B(){
B b(S(1,2),3);// FIXME: There should be no execution path on which this is false.
clang_analyzer_eval(b.s.x==1);// expected-warning{{TRUE}}
// expected-warning@-1{{FALSE}}
// FIXME: There should be no execution path on which this is false.
clang_analyzer_eval(b.s.y==2);// expected-warning{{TRUE}}
// expected-warning@-1{{FALSE}}
clang_analyzer_eval(b.z==3);// expected-warning{{TRUE}}
}}// namespace arguments_with_constructors
namespaceinherited_constructor_crash{classa{public:a(int);};structb:a{using a::a;// Ihnerited ctor.
};voidc(){int d;// This construct expr utilizes the inherited ctor.
// Note that d must be uninitialized to cause the crash.
(b(d));// expected-warning{{1st function call argument is an uninitialized value}}
}}// namespace inherited_constructor_crash