mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 04:16:46 +00:00

We previously took a shortcut and said that weak variables never have constant initializers (because those initializers are never correct to use outside the variable). We now say that weak variables can have constant initializers, but are never usable in constant expressions.
5 lines
112 B
C++
5 lines
112 B
C++
// RUN: %clang_cc1 %s -std=c++20 -verify
|
|
// expected-no-diagnostics
|
|
|
|
constinit int a __attribute__((weak)) = 0;
|