aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/attr-noreturn.c
blob: 5384eaf83287e68e90cfd8ee71c2892d49c67559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: clang -verify -fsyntax-only %s

static void (*fp0)(void) __attribute__((noreturn));

static void __attribute__((noreturn)) f0(void) {
  fatal();
}

// On K&R
int f1() __attribute__((noreturn));

int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' attribute only applies to function types}}

int f2() __attribute__((noreturn(1, 2))); // expected-error {{attribute requires 0 argument(s)}}