From 14fb8587be65342ceb87f39d54a1452a70ecca94 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 8 Dec 2008 02:21:03 +0000 Subject: 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. llvm-svn: 60680 --- clang/lib/AST/ExprConstant.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/AST') 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(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; } -- cgit v1.2.3