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

Operator<< for QDebug public and global

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes