Author: efriedma Date: Fri Feb 8 18:22:17 2019 New Revision: 353598 URL: http://llvm.org/viewvc/llvm-project?rev=353598&view=rev Log: Fix buildbot failure from r353569.
I assumed lvalue-to-rvalue conversions of array type would never happen, but apparently clang-tidy tries in some cases. Modified: cfe/trunk/lib/AST/ExprConstant.cpp Modified: cfe/trunk/lib/AST/ExprConstant.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=353598&r1=353597&r2=353598&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprConstant.cpp (original) +++ cfe/trunk/lib/AST/ExprConstant.cpp Fri Feb 8 18:22:17 2019 @@ -3370,8 +3370,15 @@ static bool handleLValueToRValueConversi } else if (isa<StringLiteral>(Base) || isa<PredefinedExpr>(Base)) { // Special-case character extraction so we don't have to construct an // APValue for the whole string. - assert(LVal.Designator.Entries.size() == 1 && + assert(LVal.Designator.Entries.size() <= 1 && "Can only read characters from string literals"); + if (LVal.Designator.Entries.empty()) { + // Fail for now for LValue to RValue conversion of an array. + // (This shouldn't show up in C/C++, but it could be triggered by a + // weird EvaluateAsRValue call from a tool.) + Info.FFDiag(Conv); + return false; + } if (LVal.Designator.isOnePastTheEnd()) { if (Info.getLangOpts().CPlusPlus11) Info.FFDiag(Conv, diag::note_constexpr_access_past_end) << AK_Read; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits