From 872b9acd95f8ecec52db6fe4053bc349ae2dfa43 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 21 Jan 2009 22:32:33 +0000 Subject: [PATCH] Fix Sema::Owned(ExprResult) to not use a ternary operator. Necessary to work around a Visual Studio compiler bug. Thanks to Doug Gregor for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62723 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/Sema.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 80168544dc..49e3eb8b5c 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -249,7 +249,9 @@ public: OwningExprResult Owned(Expr* E) { return OwningExprResult(*this, E); } OwningExprResult Owned(ExprResult R) { - return R.isInvalid ? ExprError() : OwningExprResult(*this, R.Val); + if (R.isInvalid) + return ExprError(); + return OwningExprResult(*this, R.Val); } OwningStmtResult Owned(Stmt* S) { return OwningStmtResult(*this, S); } -- 2.40.0