2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -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}} \
|
2010-09-05 08:04:01 +08:00
|
|
|
expected-warning {{initializing 'char *' with an expression of type 'const char [1]' discards qualifiers}}
|
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}}
|
|
|
|
|