由于未打包的非POD字段而忽略打包的属性

mic*_*mic 5 c++ oop types avr g++

下面的代码在使用avr-g ++编译器编译时忽略了打包属性,但由于未打包的非POD字段'float&foo :: BAR',导致我遇到此错误

是什么原因?

class foo {  
 public:       
     foo(float &bar);    
 private:  
     float &BAR;  
};

foo::foo(float &bar):BAR(bar)  
{

}

int main()  
{  
 float something;  
 foo fooobject(something);  
}
Run Code Online (Sandbox Code Playgroud)

mat*_*tch 6

它似乎是一个编译器错误:https : //gcc.gnu.org/bugzilla/show_bug.cgi?id=58798