aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-06 01:07:37 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-06 01:07:37 +0000
commit1f1b3b3bdec84e2204f18732e3241f6907a17309 (patch)
treeb85f085b1449170b244e166ea55d95ef411245d0 /lib/AST/Expr.cpp
parent85248734f404fbb9b2f88ecd5296761a8578def6 (diff)
Per discussion, remove the explicit restriction on static const data members with
out-of-line initializers as integer constant expressions. Fixes PR6206. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 50ddc9156a..4e6cdcab00 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1665,16 +1665,9 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
return ICEDiag(2, cast<DeclRefExpr>(E)->getLocation());
}
- // C++ [class.static.data]p4:
- // If a static data member is of const integral or const
- // enumeration type, its declaration in the class definition can
- // specify a constant-initializer which shall be an integral
- // constant expression (5.19). In that case, the member can appear
- // in integral constant expressions.
- if (ID->isOutOfLine()) {
- Dcl->setInitKnownICE(false);
- return ICEDiag(2, cast<DeclRefExpr>(E)->getLocation());
- }
+ // It's an ICE whether or not the definition we found is
+ // out-of-line. See DR 721 and the discussion in Clang PR
+ // 6206 for details.
if (Dcl->isCheckingICE()) {
return ICEDiag(2, cast<DeclRefExpr>(E)->getLocation());