aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-12-08 02:21:03 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-12-08 02:21:03 +0000
commite9a0f43927041e2bcc89140c338dfae207ad3c3b (patch)
tree58a97cca29623e74d6a7275a0c33a38dc10f6de1 /lib/AST/ExprConstant.cpp
parent3cc461dccbfd3503f8a07cd46dae838245c27f26 (diff)
Workaround for PR3173. The fix is correct in the sense that if the enum
code were working correctly, it would be a no-op, but it's not really a proper fix. That said, I don't really want to touch the enum code at the moment because I don't understand it very well, and this seems to be a relatively visible regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 9eeaa868a5..341baeab85 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/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;
}