]> granicus.if.org Git - clang/commitdiff
Fix Sema::Owned(ExprResult) to not use a ternary operator. Necessary to work around...
authorSteve Naroff <snaroff@apple.com>
Wed, 21 Jan 2009 22:32:33 +0000 (22:32 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 21 Jan 2009 22:32:33 +0000 (22:32 +0000)
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

index 80168544dcbcb10b30684f7ae8a2fafaed0c7a7f..49e3eb8b5c0df5dfb70d1fd750857e189f57517f 100644 (file)
@@ -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); }