diff options
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Interp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp index b3ac84c..7cc0d2a 100644 --- a/clang/lib/AST/ByteCode/Interp.cpp +++ b/clang/lib/AST/ByteCode/Interp.cpp @@ -670,7 +670,8 @@ bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, if (const auto *VD = Ptr.getDeclDesc()->asVarDecl(); VD && (VD->isConstexpr() || VD->hasGlobalStorage())) { - if (!S.getLangOpts().CPlusPlus23 && VD == S.EvaluatingDecl) { + if (VD == S.EvaluatingDecl && + !(S.getLangOpts().CPlusPlus23 && VD->getType()->isReferenceType())) { if (!S.getLangOpts().CPlusPlus14 && !VD->getType().isConstant(S.getASTContext())) { // Diagnose as non-const read. |