1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s 2*f4a2713aSLionel Sambuc abcdefghi12(void)3*f4a2713aSLionel Sambucvoid abcdefghi12(void) { 4*f4a2713aSLionel Sambuc const char (*ss)[12] = &__func__; 5*f4a2713aSLionel Sambuc static int arr[sizeof(__func__)==12 ? 1 : -1]; 6*f4a2713aSLionel Sambuc } 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc char *X = __func__; // expected-warning {{predefined identifier is only valid}} \ 9*f4a2713aSLionel Sambuc expected-warning {{initializing 'char *' with an expression of type 'const char [1]' discards qualifiers}} 10*f4a2713aSLionel Sambuc a()11*f4a2713aSLionel Sambucvoid a() { 12*f4a2713aSLionel Sambuc __func__[0] = 'a'; // expected-error {{variable is not assignable}} 13*f4a2713aSLionel Sambuc } 14*f4a2713aSLionel Sambuc 15*f4a2713aSLionel Sambuc // rdar://6097892 - GCC permits this insanity. 16*f4a2713aSLionel Sambuc const char *b = __func__; // expected-warning {{predefined identifier is only valid}} 17*f4a2713aSLionel Sambuc const char *c = __FUNCTION__; // expected-warning {{predefined identifier is only valid}} 18*f4a2713aSLionel Sambuc const char *d = __PRETTY_FUNCTION__; // expected-warning {{predefined identifier is only valid}} 19*f4a2713aSLionel Sambuc 20