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

Build failure: error: expected template-name before '<' token, qabstractgallery.cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.13.2, 5.14.1
    • Build tools: moc
    • None
    • Debian testing
      gcc version 9.2.1 20200224 (Debian 9.2.1-30)
    • Linux/X11

    Description

      When building qt from source I get following error:

       

      dwojt@debian:~/local/qt5$ ~/sources/external/qt5/configure -developer-build -opensource -confirm-license -nomake examples -nomake tests
      (...)
      dwojt@debian:~/local/qt5$ make
      In file included from /usr/include/c++/9/memory:67,
                       from .moc/moc_qabstractgallery.cpp:9,
                       from /home/dwojt/sources/external/qt5/qtdocgallery/src/gallery/qabstractgallery.cpp:125:
      /usr/include/c++/9/bits/stl_raw_storage_iter.h:69:22: error: expected template-name before '<' token
         69 |     : public iterator<output_iterator_tag, void, void, void, void>
            |                      ^

      When investigating contents of qabstractgallery.cpp, I found that "moc_qabstractgallery.cpp" is included from within QT_{BEGIN|END}_NAMESPACE_DOCGALLERY .

      Then moc_qabstractgallery.cpp includes "<memory>". Effectively "<memory>" gets included from namespace "QDocGallery".

      Adding "#include <memory>" before QT_BEGIN_NAMESPACE_DOCGALLERY allows compilation of this file to succeed, which confirms my diagnosis.

      Please prevent system includes from being included from inside a namespace.

       

       

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              domin144 Dominik Wójt
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes