[PATCH] D119493: Fixing surplus assert condition in EvaluateTemporary
zhouyizhou via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 18 17:27:51 PDT 2022
zhouyizhou updated this revision to Diff 416636.
zhouyizhou edited the summary of this revision.
zhouyizhou added reviewers: mizvekov, eli.friedman, EricWF, faisalv.
Herald added a project: All.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119493/new/
https://reviews.llvm.org/D119493
Files:
clang/lib/AST/ExprConstant.cpp
clang/test/AST/issue53741.cpp
Index: clang/test/AST/issue53741.cpp
===================================================================
--- /dev/null
+++ clang/test/AST/issue53741.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
+typedef bool Var;
+bool foobool() {
+ return (bool().Var::~Var(), false);
+}
+
+
Index: clang/lib/AST/ExprConstant.cpp
===================================================================
--- clang/lib/AST/ExprConstant.cpp
+++ clang/lib/AST/ExprConstant.cpp
@@ -10173,7 +10173,7 @@
/// Evaluate an expression of record type as a temporary.
static bool EvaluateTemporary(const Expr *E, LValue &Result, EvalInfo &Info) {
assert(!E->isValueDependent());
- assert(E->isPRValue() && E->getType()->isRecordType());
+ assert(E->isPRValue());
return TemporaryExprEvaluator(Info, Result).Visit(E);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119493.416636.patch
Type: text/x-patch
Size: 850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220319/ce814769/attachment-0001.bin>
More information about the cfe-commits
mailing list