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

MOC is confused by raw string literal and namespace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: Build tools: moc
    • Labels:
      None
    • Environment:
      Arch Linux
    • Platform/s:
      Linux/Wayland

      Description

      Here is example:

      main.cpp :

      #include <QObject>
      #include "my_header.h"
      
      class MyClass: public QObject {
        Q_OBJECT
      };
      
      

      my_header.h :

      #include <string>
      
      namespace MY_NAMESPACE {
        void test() {
          std::string test(R"(")");
        }
      }
      
      

      When I run "moc main.cpp" it puts MyClass in MY_NAMESPACE, but MyClass isn't in MY_NAMESPACE

        Attachments

        1. main.cpp
          0.1 kB
          Nazar Kazakov
        2. my_header.h
          0.1 kB
          Nazar Kazakov

          Issue Links

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

            Activity

              People

              Assignee:
              ogoffart Olivier Goffart (Woboq GmbH)
              Reporter:
              nazar01 Nazar Kazakov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes