]> granicus.if.org Git - clang/commitdiff
Tweak r196646
authorAlp Toker <alp@nuanti.com>
Sat, 7 Dec 2013 07:32:31 +0000 (07:32 +0000)
committerAlp Toker <alp@nuanti.com>
Sat, 7 Dec 2013 07:32:31 +0000 (07:32 +0000)
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

lib/Sema/SemaExprCXX.cpp

index 48b49f550cf3c03492930954e7861705000b239c..c2b0fb1c01e0137d4a2c285331bb03b14bd8358b 100644 (file)
@@ -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));