Using fresh installation of Espressif IDE 3.1.0 and ESP IDF 5.3.1 I'm getting an error "Initializer element is not a compile-time constant" with next code:
#define __FILENAME__ (__builtin_strrchr( "/" __FILE__, '/') + 1)
static const char *TAG = __FILENAME__;

In the latest 2.x version there is no such error.
Also, the code is successfully compiling with GCC.
Using fresh installation of Espressif IDE 3.1.0 and ESP IDF 5.3.1 I'm getting an error "Initializer element is not a compile-time constant" with next code:
In the latest 2.x version there is no such error.
Also, the code is successfully compiling with GCC.