diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-07-19 07:18:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-19 07:18:51 +0200 |
commit | ef49ed4829bc1b111e31a08d70b0ccae66427ebf (patch) | |
tree | 7773c35177b9813dc562feda358811cb63055610 /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | a5481e7d5af07161b5d135100cb8754ae614accf (diff) | |
download | llvm-ef49ed4829bc1b111e31a08d70b0ccae66427ebf.zip llvm-ef49ed4829bc1b111e31a08d70b0ccae66427ebf.tar.gz llvm-ef49ed4829bc1b111e31a08d70b0ccae66427ebf.tar.bz2 |
[clang][bytecode] Use bytecode interpreter in isPotentialConstantExprU… (#149462)
…nevaluated
Fake a function call to the given function and evaluate the given
expression as if it was part of that function call.
Fixes #149383
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index ea473730..65ad7ca 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -6670,6 +6670,11 @@ bool Compiler<Emitter>::visitDeclRef(const ValueDecl *D, const Expr *E) { } // Function parameters. if (const auto *PVD = dyn_cast<ParmVarDecl>(D)) { + if (Ctx.getLangOpts().CPlusPlus && !Ctx.getLangOpts().CPlusPlus11 && + !D->getType()->isIntegralOrEnumerationType()) { + return this->emitInvalidDeclRef(cast<DeclRefExpr>(E), + /*InitializerFailed=*/false, E); + } if (auto It = this->Params.find(PVD); It != this->Params.end()) { if (IsReference || !It->second.IsPtr) return this->emitGetParam(classifyPrim(E), It->second.Offset, E); |