aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ASTContext.cpp3
-rw-r--r--test/SemaTemplate/enum-argument.cpp13
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index d6e094e5b4..aa98910f0f 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -2729,6 +2729,9 @@ unsigned ASTContext::getIntegerRank(Type *T) {
/// \returns the type this bit-field will promote to, or NULL if no
/// promotion occurs.
QualType ASTContext::isPromotableBitField(Expr *E) {
+ if (E->isTypeDependent() || E->isValueDependent())
+ return QualType();
+
FieldDecl *Field = E->getBitField();
if (!Field)
return QualType();
diff --git a/test/SemaTemplate/enum-argument.cpp b/test/SemaTemplate/enum-argument.cpp
index de89487bd5..7d23757067 100644
--- a/test/SemaTemplate/enum-argument.cpp
+++ b/test/SemaTemplate/enum-argument.cpp
@@ -21,3 +21,16 @@ struct X0 {
};
X0<int> x0i;
+
+namespace rdar8020920 {
+ template<typename T>
+ struct X {
+ enum { e0 = 32 };
+
+ unsigned long long bitfield : e0;
+
+ void f(int j) {
+ bitfield + j;
+ }
+ };
+}