1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -verify %s
8 bool PR14634_implicit(int x) {
13 void intAsBoolAsSwitchCondition(int c) {
14 switch ((bool)c) { // expected-warning {{switch condition has boolean value}}
19 switch ((int)(bool)c) { // no-warning
25 int *&castToIntPtrLValueRef(char *p) {
26 return (int *&)*(int *)p;
28 bool testCastToIntPtrLValueRef(char *p, int *s) {
29 return castToIntPtrLValueRef(p) != s; // no-crash
32 int *&&castToIntPtrRValueRef(char *p) {
33 return (int *&&)*(int *)p;
35 bool testCastToIntPtrRValueRef(char *p, int *s) {
36 return castToIntPtrRValueRef(p) != s; // no-crash
39 bool retrievePointerFromBoolean(int *p) {
41 *reinterpret_cast<int **>(&q) = p;