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

moc can not parse attributes on namespaces

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.8.3
    • Fix Version/s: 5.0.0
    • Component/s: Build tools: moc
    • Labels:
      None

      Description

      #include <QObject>
      
      namespace Something //__attribute__ ((__visibility__ (default)))
      {
      
      }
      
      class MyClass : public QObject
      {
        Q_OBJECT
      
      };
      

      Uncommenting the attribute makes moc fail:

      stephen@hal:/tmp$ moc bad.h
      bad.h:4: Parse error at "Something"
      

      Apparently GCC headers now add such attributes to the std namespace, eg /usr/include/c++/4.6/bits/stl_relops.h. This causes build errors for KDE phonon: http://build.kde.org/job/phonon_master/lastBuild/console

        Attachments

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

          Activity

            People

            Assignee:
            laknoll Lars Knoll
            Reporter:
            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes