summaryrefslogtreecommitdiffstats
path: root/test/Sema/cast.c
blob: d2e3e0c7e3a1bfafcf792a92495c31b45fbcf161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: clang-cc -fsyntax-only %s -verify

typedef struct { unsigned long bits[(((1) + (64) - 1) / (64))]; } cpumask_t;
cpumask_t x;
void foo() {
  (void)x;
}
void bar() {
  char* a;
  double b;
  b = (double)a; // expected-error {{pointer cannot be cast to type}}
  a = (char*)b; // expected-error {{cannot be cast to a pointer type}}
}

long bar1(long *next) {
        return (long)(*next)++;  
}

OpenPOWER on IntegriCloud