Bug 276551 - build failure - Overloading ambiguity in kwin/geometry.cpp
Summary: build failure - Overloading ambiguity in kwin/geometry.cpp
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2011-06-26 17:29 UTC by tropikhajma
Modified: 2018-10-27 04:18 UTC (History)
0 users

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 tropikhajma 2011-06-26 17:29:19 UTC
Version:           SVN (using Devel) 
OS:                Solaris

building kde-workspace 4.6.90 on Solaris 11e with Sun Studio 12u1 fails with the below message:
...
"/export/home/kdebuild/packages/BUILD/kde-workspace-4.6.90/kwin/geometry.cpp", line 1638: Error: Overloading ambiguity between "KWin::operator<<(QDebug&, const KWin::Toplevel*)" and "operator<<(QDebug, const QObject*)".

doing 
-    kDebug(1212) << this << bool(value_mask & (CWX|CWWidth|CWY|CWHeight)) <<
+    kDebug(1212) << (QObject*)this << bool(value_mask & (CWX|CWWidth|CWY|CWHeight)) <<
fixed it for me, but I'm not sure how much hackish this solution is.


Reproducible: Always

Steps to Reproduce:
build it


Expected Results:  
builds fine
Comment 1 Thomas Lübking 2011-06-26 22:05:29 UTC
Pleas try:

kDebug(1212) << static_cast<KWin::Toplevel*>(this) << bool(value_mask &
(CWX|CWWidth|CWY|CWHeight)) <<

(classname & mempos isn't that interesting here.. ;-)
Comment 2 tropikhajma 2011-07-06 10:52:02 UTC
still the same:

"/home/test/packages/BUILD/kde-workspace-4.6.90/kwin/geometry.cpp", line 1638: Error: Overloading ambiguity between "KWin::operator<<(QDebug&, const KWin::Toplevel*)" and "operator<<(QDebug, const QObject*)".
Comment 3 Thomas Lübking 2011-07-06 22:20:36 UTC
great :-(
add "explicit" before the constructor in toplevel.h - it /should/ do, but i don't know suns compiler at all.

Sorry if the below is obvious to you ;-)

// snip of toplevel.h ---------------

class Toplevel
    : public QObject, public KDecorationDefines
{
    Q_OBJECT
public:
    Toplevel(Workspace *ws); // that's the constructor
    Window frameId() const;
    Window window() const;
    Workspace* workspace() const;

--->

class Toplevel
    : public QObject, public KDecorationDefines
{
    Q_OBJECT
public:
    explicit Toplevel(Workspace *ws); // see the "explicit" before the constructor?
    Window frameId() const;
    Window window() const;
    Workspace* workspace() const;
Comment 4 Thomas Lübking 2012-03-19 00:17:18 UTC
did the explicit constructor resolve it for you as well?
(if we casted to QObject we could as well omit the debug out)
Comment 5 tropikhajma 2012-03-21 05:35:34 UTC
Hi, Sorry to miss your original request.
Indeed, adding the explicit statement fixes the problem here. Thanks!
Comment 6 Andrew Crouthamel 2018-09-23 02:22:46 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Andrew Crouthamel 2018-10-27 04:18:39 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!