1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // expected-no-diagnostics
4 extern void __assert_fail (__const
char *__assertion
, __const
char *__file
,
5 unsigned int __line
, __const
char *__function
)
6 __attribute__ ((__noreturn__
));
8 ((expr) ? (void)(0) : __assert_fail (#expr, __FILE__, __LINE__, __func__))
21 void setP(ButterFly
*inP
) {
27 ButterFly
*inP
= getInP();
31 int c
= p
->triggerderef(); // no-warning
40 typedef const int *Ty
;
42 Ty
notNullArg(Ty cf
) __attribute__((nonnull
));
43 typedef const void *CFTypeRef
;
45 inline void radar13224271_callee(Ty def
, Ty
& result
) {
47 // Clearly indicates that result cannot be 0 if def is not NULL.
48 assert( (result
!= 0) || (def
== 0) );
50 void radar13224271_caller()
53 radar13224271_callee(getTyVal(), value
);
54 notNullArg(value
); // no-warning
70 void test(int *p1
, int *p2
) {
82 void testRefToField(Bar
*b
) {
84 int &x
= b
->x
; // no-warning
88 namespace get_deref_expr_with_cleanups
{
93 // The argument won't be used, but it'll cause cleanups
94 // to appear around the call site.
95 S
*get_conjured(S _
) {
100 void test_conjured() {
101 S
&s
= *get_conjured(S()); // no-warning
103 } // namespace get_deref_expr_with_cleanups