Skip to content

Commit 7d16e10

Browse files
fangguohjmjohnson
authored andcommitted
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. ```
1 parent d872310 commit 7d16e10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void FastWriter::writeValue(const Value& value) {
425425
// //////////////////////////////////////////////////////////////////
426426

427427
StyledWriter::StyledWriter()
428-
: rightMargin_(74), indentSize_(3), addChildValues_() {}
428+
: rightMargin_(74), indentSize_(3), addChildValues_(false) {}
429429

430430
JSONCPP_STRING StyledWriter::write(const Value& root) {
431431
document_.clear();

0 commit comments

Comments
 (0)