Skip to content

Commit 1aef2c5

Browse files
Document C++ Proto object after parse failure being similar to moved-from guarantees.
PiperOrigin-RevId: 936065222
1 parent 45a4770 commit 1aef2c5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

content/reference/cpp/cpp-generated.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ strings.
109109
- `string DebugString()`: Return a string giving the `text_format`
110110
representation of the proto (should only be used for debugging).
111111

112+
If parsing fails (methods returning `false`), the message is left in an
113+
arbitrary but valid state. Similar to a moved-from object in C++, it is safe to
114+
destroy the message or `Clear()` it, but its contents should otherwise be
115+
considered unspecified.
116+
112117
In addition to these methods, the `Foo` class defines the following methods:
113118

114119
- `Foo()`: Default constructor.

0 commit comments

Comments
 (0)