minix/external/bsd/llvm/dist/clang/test/Sema/predef.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

19 lines
776 B
C

// RUN: %clang_cc1 -fsyntax-only -verify %s
void abcdefghi12(void) {
const char (*ss)[12] = &__func__;
static int arr[sizeof(__func__)==12 ? 1 : -1];
}
char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
expected-warning {{initializing 'char *' with an expression of type 'const char [1]' discards qualifiers}}
void a() {
__func__[0] = 'a'; // expected-error {{variable is not assignable}}
}
// rdar://6097892 - GCC permits this insanity.
const char *b = __func__; // expected-warning {{predefined identifier is only valid}}
const char *c = __FUNCTION__; // expected-warning {{predefined identifier is only valid}}
const char *d = __PRETTY_FUNCTION__; // expected-warning {{predefined identifier is only valid}}