aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-08-17 08:47:57 +0200
committerGitHub <noreply@github.com>2025-08-17 08:47:57 +0200
commite44784fb44bd00acc0ecd25537a359c3a1df8f17 (patch)
tree5123d1d446f7870f91276d7bd28c91e800c4f600 /clang/lib/AST/ByteCode/Compiler.cpp
parentea4325f174baca7d12e128db4f9f3b41a918da67 (diff)
downloadllvm-e44784fb44bd00acc0ecd25537a359c3a1df8f17.zip
llvm-e44784fb44bd00acc0ecd25537a359c3a1df8f17.tar.gz
llvm-e44784fb44bd00acc0ecd25537a359c3a1df8f17.tar.bz2
[clang][bytecode] Fix pseudo dtor calls on non-pointers (#153970)
The isGLValue() check made us ignore expressions we shouldn't ignore.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 6c6c8d4..b228cea 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -5146,7 +5146,8 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
if (!this->emitCheckPseudoDtor(E))
return false;
const Expr *Base = PD->getBase();
- if (!Base->isGLValue())
+ // E.g. `using T = int; 0.~T();`.
+ if (OptPrimType BaseT = classify(Base); !BaseT || BaseT != PT_Ptr)
return this->discard(Base);
if (!this->visit(Base))
return false;