blob: f21a3d3265a56c711b85d74989dd371ab93542ec [file] [log] [blame]
Pekka Jaaskelainen8690a682014-02-20 13:52:08 +00001// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
2
3void foo(void*);
4
5void bar()
6{
7 // declaring a function pointer is an error
8 void (*fptr)(int); // expected-error{{pointers to functions are not allowed}}
9
10 // taking the address of a function is an error
11 foo((void*)foo); // expected-error{{taking address of function is not allowed}}
12 foo(&foo); // expected-error{{taking address of function is not allowed}}
13
14 // just calling a function is correct
15 foo(0);
16}