Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-80695

Operator<< for QDebug public and global

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.0
    • Core: I/O
    • None

    Description

      All the operator<< for QDebug should be hidden friends ideally.

      The result of not having them be hidden friends is that the following compiles:

      #include <qdebug.h>
      #include <qstring.h>
      #include <vector>
      void foo() {
          QString *ptr = nullptr;
          ptr << std::vector<int>{}
      }
      

      But it doesn't compile (which it shouldn't), if you comment out the include of qdebug.h.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            allan.jensen Allan Sandfeld Jensen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes