Don't try to take the address of a bitfield; fixes PR2310.

llvm-svn: 50966
This commit is contained in:
Eli Friedman 2008-05-12 15:06:05 +00:00
parent 2b84ba4c9b
commit 6e31321043
2 changed files with 12 additions and 5 deletions

View File

@ -304,12 +304,11 @@ void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {
// FIXME: Are initializers affected by volatile?
if (E->getType()->isComplexType()) {
CGF.EmitComplexExprIntoAddr(E, LV.getAddress(), false);
return;
} else if (CGF.hasAggregateLLVMType(E->getType())) {
CGF.EmitAnyExpr(E, LV.getAddress(), false);
} else {
CGF.EmitStoreThroughLValue(CGF.EmitAnyExpr(E), LV, E->getType());
}
RValue RV = CGF.EmitAnyExpr(E, LV.getAddress(), false);
if (CGF.hasAggregateLLVMType(E->getType()))
return;
CGF.EmitStoreThroughLValue(RV, LV, E->getType());
}
void AggExprEmitter::EmitNullInitializationToLValue(LValue LV, QualType T) {

View File

@ -2,3 +2,11 @@
typedef struct { unsigned int i: 1; } c;
const c d = { 1 };
// PR2310
struct Token {
unsigned n : 31;
};
void sqlite3CodeSubselect(){
struct Token one = { 1 };
}