summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-24 20:13:53 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-24 20:13:53 +0000
commite05d3cb770d1b710c15bfdb89a417d48e3226741 (patch)
tree9064e705cf2c0d8020ba9565f4b936138c04c3ff /clang/lib/AST/ASTContext.cpp
parent722bff2c7dd668fbbaddf7891924474efcbf16e9 (diff)
downloadbcm5719-llvm-e05d3cb770d1b710c15bfdb89a417d48e3226741.tar.gz
bcm5719-llvm-e05d3cb770d1b710c15bfdb89a417d48e3226741.zip
A type- or value-dependent expression cannot use bitfield
promotion. Fixes <rdar://problem/8020920>. llvm-svn: 104545
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index d6e094e5b4a..aa98910f0ff 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud