From: Steve Naroff Date: Wed, 21 Jan 2009 22:32:33 +0000 (+0000) Subject: Fix Sema::Owned(ExprResult) to not use a ternary operator. Necessary to work around... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=872b9acd95f8ecec52db6fe4053bc349ae2dfa43;p=clang 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 --- 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); }