Bug 361473 - master: parameter declarator cannot be qualified QPen pen(QColor(Qt::transparent));
Summary: master: parameter declarator cannot be qualified QPen pen(QColor(Qt::...
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-06 21:00 UTC by zl29ah
Modified: 2016-04-16 09:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zl29ah 2016-04-06 21:00:35 UTC
[ 17%] Building CXX object src/lib/marble/CMakeFiles/marblewidget-qt5.dir/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp.o
cd /var/tmp/paludis/kde-apps-marble-9999/work/marble-9999_build/src/lib/marble && /usr/bin/clang++  -DMAKE_MARBLE_LIB -DMARBLE_DBUS -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SCRIPT_LIB -DQT_SVG_LIB -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtSvg -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtPrintSupport -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtScript -isystem /usr/include/qt5/QtXml -I/usr/include/qt5/QtSql -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999 -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/projections -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/data -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/handlers/dgml -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/parser -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/writer -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/scene -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/graphicsview -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999_build/src -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999_build/src/lib/marble -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/routing -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/handlers -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/handlers/kml -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/layers -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/osm -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/cloudsync -I/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/astro -isystem /usr/include/qt5/QtWebKitWidgets -isystem /usr/include/qt5/QtWebKit -I/usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtQuick -isystem /usr/include/qt5/QtQml -isystem /usr/include/qt5/QtOpenGL -isystem /usr/include/qt5/QtDBus   -DQT_NO_DEBUG -DNDEBUG -O2 -pipe -O2 -pipe -march=native  -std=c++0x -fPIC   -DKML_LAZY_IMP -fPIC -o CMakeFiles/marblewidget-qt5.dir/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp.o -c /var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp:114:29: error: 
      parameter declarator cannot be qualified
        QPen pen(QColor(Qt::transparent));
                        ~~~~^
/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp:114:17: warning: 
      parentheses were disambiguated as a function declaration [-Wvexing-parse]
        QPen pen(QColor(Qt::transparent));
                ^~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp:114:18: note: 
      add a pair of parentheses to declare a variable
        QPen pen(QColor(Qt::transparent));
                 ^
                 (                      )
/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp:115:12: error: 
      member reference base type 'QPen (QColor)' is not a structure or union
        pen.setWidthF(currentPen.widthF());
        ~~~^~~~~~~~~~
/var/tmp/paludis/kde-apps-marble-9999/work/marble-9999/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp:116:18: error: 
      no matching member function for call to 'setPen'
        painter->setPen(pen);
        ~~~~~~~~~^~~~~~
/usr/include/qt5/QtGui/qpainter.h:181:10: note: candidate function not viable: no known
      conversion from 'QPen (QColor)' to 'const QColor' for 1st argument
    void setPen(const QColor &color);
         ^
/usr/include/qt5/QtGui/qpainter.h:182:10: note: candidate function not viable: no known
      conversion from 'QPen (QColor)' to 'const QPen' for 1st argument
    void setPen(const QPen &pen);
         ^
/usr/include/qt5/QtGui/qpainter.h:183:10: note: candidate function not viable: no known
      conversion from 'QPen (QColor)' to 'Qt::PenStyle' for 1st argument
    void setPen(Qt::PenStyle style);
         ^
Comment 1 Dennis Nienhüser 2016-04-07 20:07:42 UTC
Related to https://en.wikipedia.org/wiki/Most_vexing_parse
Comment 2 Dennis Nienhüser 2016-04-16 09:01:12 UTC
Git commit fcadeaf13f730dd66afc1faffa800cd64c662710 by Dennis Nienhüser.
Committed on 16/04/2016 at 08:52.
Pushed by nienhueser into branch 'master'.

Avoid syntactic ambiguity

M  +1    -1    src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp

http://commits.kde.org/marble/fcadeaf13f730dd66afc1faffa800cd64c662710