Debian Codegraph @

clang/test/AST/Interp/weak.cpp

raw
1 // RUN: %clang_cc1 -std=c++20 -fexperimental-new-constant-interpreter -verify=expected,both %s
2 // RUN: %clang_cc1 -std=c++20 -verify=ref,both %s
3
4
5
6
7 /// FIXME: The new interpreter also emits the "address of weak declaration" note in the pointer-to-bool case.
8
9 [[gnu::weak]] extern int a;
10 int ha[(bool)&a]; // both-warning {{variable length arrays in C++ are a Clang extension}} \
11 // expected-note {{comparison against address of weak declaration}} \
12 // both-error {{variable length array declaration not allowed at file scope}}
13 int ha2[&a == nullptr]; // both-warning {{variable length arrays in C++ are a Clang extension}} \
14 // both-note {{comparison against address of weak declaration '&a' can only be performed at runtime}} \
15 // both-error {{variable length array declaration not allowed at file scope}}