fiexd “Cannot take the address of a bit field.”

```c++
 #include <iostream>

class TestBool
{
public:
    TestBool():addChildValues_(){}
    TestBool(int):addChildValues_(false){}
    bool addChildValues_ : 1;
    bool indented_ : 1;
};


int main()
{
    std::cout << "\n TestBool () addChildValues_ = " << TestBool().addChildValues_;
    std::cout << "\n TestBool false addChildValues_ = " << TestBool(3).addChildValues_;
    return 0;
}
```

```text
root@osssvr-1 # /opt/SUNWspro/prod/bin/CC  testbool.cpp -o testbool   
Error: Cannot take the address of a bit field.
1 Error(s) detected.
```
This commit is contained in:
fangguo 2018-09-25 08:57:36 +08:00 committed by Hans Johnson
parent d8723104f3
commit 7d16e10113

View File

@ -425,7 +425,7 @@ void FastWriter::writeValue(const Value& value) {
// //////////////////////////////////////////////////////////////////
StyledWriter::StyledWriter()
: rightMargin_(74), indentSize_(3), addChildValues_() {}
: rightMargin_(74), indentSize_(3), addChildValues_(false) {}
JSONCPP_STRING StyledWriter::write(const Value& root) {
document_.clear();