https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92886

            Bug ID: 92886
           Summary: Inappropriate comment for std::ios_base::trunc
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kakkoko at pushf dot jp
  Target Milestone: ---

The comment attached to std::ios_base::trunc looks wrong.

libstdc++-v3/include/bits/ios_base.h:

    /// Open for input.  Default for @c ofstream.
    static const openmode trunc =       _S_trunc;

"Open for input"?  Hmm... It looks copy-pasted from the comment on
std::ios_base::in...

    /// Open for input.  Default for @c ifstream and fstream.
    static const openmode in =          _S_in;

Proposal:

-    /// Open for input.  Default for @c ofstream.
+    /// Truncate to zero length after opening.  Default for @c ofstream.
     static const openmode trunc =      _S_trunc;

Reply via email to