[all-commits] [llvm/llvm-project] 8079a2: [clang][bytecode] Diagnose reference to non-conste...
yronglin via All-commits
all-commits at lists.llvm.org
Tue Oct 15 09:11:34 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8079a2c57862115f7fe4dbe72f07cf944a7f6aed
https://github.com/llvm/llvm-project/commit/8079a2c57862115f7fe4dbe72f07cf944a7f6aed
Author: yronglin <yronglin777 at gmail.com>
Date: 2024-10-16 (Wed, 16 Oct 2024)
Changed paths:
M clang/lib/AST/ByteCode/Interp.cpp
A clang/test/AST/ByteCode/constexpr.c
Log Message:
-----------
[clang][bytecode] Diagnose reference to non-constexpr variable of const type in C23 constexpr (#112211)
```cpp
const int V33 = 4;
const int V34 = 0;
const int V35 = 2;
constexpr int V36 = V33 / V34;
// expected-error at -1 {{constexpr variable 'V36' must be initialized by a constant expression}}
constexpr int V37 = V33 / V35;
// expected-error at -1 {{constexpr variable 'V37' must be initialized by a constant expression}}
```
---------
Signed-off-by: yronglin <yronglin777 at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list