Files
llvm-project/clang/test/Sema/predef.c
Chris Lattner 317e6ba07f Tighten up handling of __func__ and friends: it should be an array
of const char, and it should error if it occurs outside a function.

Is it valid in an objc method?  If so we should handle that too.

llvm-svn: 45910
2008-01-12 18:39:25 +00:00

13 lines
314 B
C

// RUN: clang -fsyntax-only -verify %s
void abcdefghi12(void) {
const char (*ss)[12] = &__func__;
static int arr[sizeof(__func__)==12 ? 1 : -1];
}
char *X = __func__; // expected-error {{predefined identifier is only valid}}
void a() {
__func__[0] = 'a'; // expected-error {{variable is not assignable}}
}