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);
 }
 


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);
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D119493: Fixing surpl... zhouyizhou via Phabricator via cfe-commits

Reply via email to