summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-12-07 07:32:31 +0000
committerAlp Toker <alp@nuanti.com>2013-12-07 07:32:31 +0000
commit49d9f488a9f1daedce3a15f97260b8903ba7ad9c (patch)
treefb6924531580355bbb658483359aa661dd664785 /clang/lib
parent8baeac7bfd25e15d07bace7bf3b749bc9d973559 (diff)
downloadbcm5719-llvm-49d9f488a9f1daedce3a15f97260b8903ba7ad9c.tar.gz
bcm5719-llvm-49d9f488a9f1daedce3a15f97260b8903ba7ad9c.zip
Tweak r196646
There was already a condition earlier in the function so just place the check there. Cleanup only. llvm-svn: 196647
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 48b49f550cf..c2b0fb1c01e 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/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));
OpenPOWER on IntegriCloud