diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-30 07:03:22 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-30 07:03:22 +0000 |
commit | 944af7156db03d4ad15973dad259ab51d405e609 (patch) | |
tree | 56cefc5d776c8482e07095e1752b4484984327c3 /lib/CodeGen/CGExprConstant.cpp | |
parent | 09c43d1e4dc7e0d2e80f2158bd1a03f7c793eb4f (diff) |
Fix for PR4108: be a bit looser with the casts that we accept in
constant initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index d7c6457ff8..e618dab33e 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -59,8 +59,9 @@ public: return EmitUnion(CGM.EmitConstantExpr(SubExpr, SubExpr->getType(), CGF), Ty); } - if (CGM.getContext().getCanonicalType(E->getSubExpr()->getType()) == - CGM.getContext().getCanonicalType(E->getType())) { + // Explicit and implicit no-op casts + QualType Ty = E->getType(), SubTy = E->getSubExpr()->getType(); + if (CGM.getContext().hasSameUnqualifiedType(Ty, SubTy)) { return Visit(E->getSubExpr()); } return 0; |