This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145037 - "operator string" defintion incorrectly resolved
Summary: "operator string" defintion incorrectly resolved
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 141108 158604 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-25 17:50 UTC by Vladimir Voskresensky
Modified: 2010-10-30 15:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2008-08-25 17:50:54 UTC
in the following example definition of method "operator string" is registered on global level => class content is not
resolved.

#include <string>

namespace litesql {
    using namespace std;
    class UpdateQuery {
        string table;
    public:
        operator std::string() const;
    };
}

namespace litesql {
    using namespace std;

    UpdateQuery::operator string() const {
        string q = "UPDATE " + table + " SET ";
        return q;
    }

}
Comment 1 nnnnnk 2008-09-02 15:16:09 UTC
Resolver can not find operator "string" in class UpdateQuery, cause it declared as "std::string".
With "std::" in definition or without "std::" in declaration everything is OK.

Comment 2 nnnnnk 2008-09-12 20:18:26 UTC
*** Issue 141108 has been marked as a duplicate of this issue. ***
Comment 3 nnnnnk 2009-02-16 13:08:38 UTC
*** Issue 158604 has been marked as a duplicate of this issue. ***
Comment 4 Alexander Simon 2009-02-17 10:04:42 UTC
fixed optimistic scenario in change set:
http://hg.netbeans.org/main/rev/4799e5b119d4
- method declaration try to find definition in case cast operator definition is declared without scope
- method definition try to find declaration in case class have exactly one cast operator with desired name
Comment 5 Quality Engineering 2009-02-18 10:10:13 UTC
Integrated into 'main-golden', will be available in build *200902180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4799e5b119d4
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing: IZ#145037:"operator string" defintion incorrectly resolved
- fixed optimistic scenario
Comment 6 Vladimir Voskresensky 2010-10-30 15:10:36 UTC
fixed other cases
http://hg.netbeans.org/cnd-main?cmd=changeset;node=2252491aeb19