summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 9eeaa868a59..341baeab85b 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -430,6 +430,9 @@ bool IntExprEvaluator::VisitDeclRefExpr(const DeclRefExpr *E) {
// Enums are integer constant exprs.
if (const EnumConstantDecl *D = dyn_cast<EnumConstantDecl>(E->getDecl())) {
Result = D->getInitVal();
+ // FIXME: This is an ugly hack around the fact that enums don't set their
+ // signedness consistently; see PR3173
+ Result.setIsUnsigned(!E->getType()->isSignedIntegerType());
return true;
}
OpenPOWER on IntegriCloud