Timm Baeder 7b0c51a439
[clang][bytecode] Fix a crash when redeclaring extern globals (#164204)
One iteration of this loop might've already fixed up the pointers of
coming globals, so check for that explicitly.

Fixes https://github.com/llvm/llvm-project/issues/164151
2025-10-20 12:55:06 +02:00

16 lines
354 B
C++

// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=both,expected %s
// RUN: %clang_cc1 -verify=both,ref %s
// both-no-diagnostics
extern const double Num;
extern const double Num = 12;
extern const int E;
constexpr int getE() {
return E;
}
const int E = 10;
static_assert(getE() == 10);