MSVC makes these string literals [1][2]. [1] https://godbolt.org/z/6vnTzbExx [2] https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170 Fixes #114 Initial commit didn't check if there was a function name when stepping through expressions ignoring parens. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D146764
10 lines
822 B
C++
10 lines
822 B
C++
// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions
|
|
|
|
void f() {
|
|
const char a[] = __FUNCTION__; // expected-warning{{initializing an array from a '__FUNCTION__' predefined identifier is a Microsoft extension}}
|
|
const char b[] = __FUNCDNAME__; // expected-warning{{initializing an array from a '__FUNCDNAME__' predefined identifier is a Microsoft extension}}
|
|
const char c[] = __FUNCSIG__; // expected-warning{{initializing an array from a '__FUNCSIG__' predefined identifier is a Microsoft extension}}
|
|
const char d[] = __func__; // expected-warning{{initializing an array from a '__func__' predefined identifier is a Microsoft extension}}
|
|
const char e[] = __PRETTY_FUNCTION__; // expected-warning{{initializing an array from a '__PRETTY_FUNCTION__' predefined identifier is a Microsoft extension}}
|
|
}
|