A type- or value-dependent expression cannot use bitfield
promotion. Fixes <rdar://problem/8020920>. llvm-svn: 104545
This commit is contained in:
parent
722bff2c7d
commit
e05d3cb770
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue