diff options
| author | Timm Baeder <tbaeder@redhat.com> | 2025-11-06 12:52:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-06 12:52:11 +0100 |
| commit | e4467fbf3077ff0d2ae9f600df129dc11fa35c0f (patch) | |
| tree | 8eeb0cbdf0b4d3921f3f0a87362b0ed99b3bd5cd /clang/lib/AST/ByteCode/Compiler.cpp | |
| parent | ee0818a1f1fab4303eeb1263ac1f6b22f3fe2110 (diff) | |
[clang][ExprConst] Handle dependent switch case statements (#166533)
By rejecting them.
Fixes https://github.com/llvm/llvm-project/issues/165555
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
| -rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 4e634000adc3..84f7e6287609 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -6007,6 +6007,8 @@ bool Compiler<Emitter>::visitSwitchStmt(const SwitchStmt *S) { CaseLabels[SC] = this->getLabel(); const Expr *Value = CS->getLHS(); + if (Value->isValueDependent()) + return false; PrimType ValueT = this->classifyPrim(Value->getType()); // Compare the case statement's value to the switch condition. |
