aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/cond-err-expand.c
blob: b52624bc9de5ec7461f47edc9759d7b48cb2e475 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
static inline void f(void)
{
	__builtin_constant_p(0);
}

void foo(void)
{
	0 ? 0 : f();
}

void bar(void)
{
	1 ? f() : 0;
}

/*
 * check-name: cond-err-expand.c
 * check-command: test-linearize -Wno-decl $file
 *
 * check-error-start
cond-err-expand.c:8:11: error: incompatible types in conditional expression (different base types):
cond-err-expand.c:8:11:    int
cond-err-expand.c:8:11:    void
cond-err-expand.c:13:11: error: incompatible types in conditional expression (different base types):
cond-err-expand.c:13:11:    void
cond-err-expand.c:13:11:    int
 * check-error-end
 *
 * check-output-ignore
 * check-output-excludes: call.* __builtin_constant_p
 */