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

moc can not parse attributes on namespaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 4.8.3
    • Build tools: moc
    • 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

            laknoll Lars Knoll
            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