llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[clang][-Wimplicit-void-ptr-cast] A new false error caused by an unexpected AST change

Open ziqingluo-90 opened this issue 1 year ago • 0 comments

git bisect shows that #136855 causes a new false error on the example below.

#include <stdatomic.h>
typedef const struct T * T_Ref;
static T_Ref _Atomic x = ATOMIC_VAR_INIT((void*)NULL);

After the commit, the AST of the global variable declaration changes---a level of -ImplicitCastExpr '_Atomic(CFStringRef)' is removed, resulting in a new error: initializer element is not a compile-time constant. (https://godbolt.org/z/aK8E9o47E)

ziqingluo-90 avatar Aug 18 '25 16:08 ziqingluo-90