2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc -fsyntax-only -verify %s
|
2008-01-12 16:14:25 +08:00
|
|
|
|
2008-01-13 02:39:25 +08:00
|
|
|
void abcdefghi12(void) {
|
2008-01-12 16:14:25 +08:00
|
|
|
const char (*ss)[12] = &__func__;
|
2008-01-13 02:39:25 +08:00
|
|
|
static int arr[sizeof(__func__)==12 ? 1 : -1];
|
2008-01-12 16:14:25 +08:00
|
|
|
}
|
|
|
|
|
2008-12-12 13:05:20 +08:00
|
|
|
char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
|
|
|
|
expected-warning {{initializing 'char const [1]' discards qualifiers, expected 'char *'}}
|
2008-01-13 02:39:25 +08:00
|
|
|
|
|
|
|
void a() {
|
|
|
|
__func__[0] = 'a'; // expected-error {{variable is not assignable}}
|
|
|
|
}
|
2008-12-12 13:05:20 +08:00
|
|
|
|
|
|
|
// 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}}
|
|
|
|
|