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

MOC creates no output if file contains raw string literal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 5.7.0, 5.12.2
    • Build tools: moc
    • None

    Description

      If I run MOC on the following header file:

      #pragma once
      #include <QObject>
      
      class MocBugTest : public QObject
      {
        Q_OBJECT
        public:
        MocBugTest()
        {
          const char* testMinimal = R"(a"//a
          )";
          const char* testRealWorld = R"(<?xml version="1.0" encoding="UTF-8"?>
            <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
          )";
        }
      };

      I get the message: 

      MocBugTest.h(0): Note: No relevant classes found. No output generated.

      It seems that MOC gets confused by the string constant containing a ", a // and a line break.

      I have added a minimal example and a real-world example. (I'd like the file to contain a hard-coded XSD.)

       

       

      Attachments

        Issue Links

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

          Activity

            People

              ogoffart Olivier Goffart (Woboq GmbH)
              roho Robin Hoens
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes