forked from OSchip/llvm-project
Don't try to take the address of a bitfield; fixes PR2310.
llvm-svn: 50966
This commit is contained in:
parent
2b84ba4c9b
commit
6e31321043
|
@ -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) {
|
||||
|
|
|
@ -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 };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue