summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn_false_to_pointer.cpp
blob: fb6f9551a7ac594997ca0b1987c224bee28d1ffd (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: %clang_cc1 -fsyntax-only -verify %s

int* j = false; // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}}

void foo(int* i, int *j=(false)) // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}}
{
  foo(false); // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}}
  foo((int*)false);
}

OpenPOWER on IntegriCloud