Skip to content

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

@ziqingluo-90

Description

@ziqingluo-90

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)

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions