From: Alp Toker Date: Sat, 7 Dec 2013 07:32:31 +0000 (+0000) Subject: Tweak r196646 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3febd63f198e4b1325f1253070130ba75bea5773;p=clang Tweak r196646 There was already a condition earlier in the function so just place the check there. Cleanup only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196647 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 48b49f550c..c2b0fb1c01 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -3925,8 +3925,11 @@ ExprResult Sema::BuildBinaryTypeTrait(BinaryTypeTrait BTT, SourceLocation RParen) { QualType LhsT = LhsTSInfo->getType(); QualType RhsT = RhsTSInfo->getType(); + QualType ResultType = Context.BoolTy; + // __builtin_types_compatible_p is a GNU C extension, not a C++ type trait. if (BTT == BTT_TypeCompatible) { + ResultType = Context.IntTy; if (getLangOpts().CPlusPlus) { Diag(KWLoc, diag::err_types_compatible_p_in_cplusplus) << SourceRange(KWLoc, RParen); @@ -3938,11 +3941,6 @@ ExprResult Sema::BuildBinaryTypeTrait(BinaryTypeTrait BTT, if (!LhsT->isDependentType() && !RhsT->isDependentType()) Value = EvaluateBinaryTypeTrait(*this, BTT, LhsT, RhsT, KWLoc); - QualType ResultType = Context.BoolTy; - // __builtin_types_compatible_p is a GNU C extension, not a C++ type trait. - if (BTT == BTT_TypeCompatible) - ResultType = Context.IntTy; - return Owned(new (Context) BinaryTypeTraitExpr(KWLoc, BTT, LhsTSInfo, RhsTSInfo, Value, RParen, ResultType));