<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>78641</bug_id>
          
          <creation_ts>2004-03-28 21:46:00 +0000</creation_ts>
          <short_desc>code completion: overloaded members in derived classes not hidden when redefined</short_desc>
          <delta_ts>2007-01-19 20:02:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kdevelop</product>
          <component>Code completion</component>
          <version>3.0.2</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Franke">franke.daniel</reporter>
          <assigned_to name="KDevelop Developers">kdevelop-devel</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>219767</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Franke">franke.daniel</who>
    <bug_when>2004-03-28 21:46:00 +0000</bug_when>
    <thetext>Version:           3.0.2 (using KDE 3.2.1, compiled sources)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:          Linux (i686) release 2.4.21-99-default

Daniel:

Assume two simple classes (stripped down example):
--
class A {
public:
      void print(const string&amp; t) { print(t.c_str()); }
      virtual void print(const char *s) { cout &lt;&lt; &quot;A: &quot; &lt;&lt; s; }
};

class B : public A {
public:
      void print(const char *s) { cout &lt;&lt; &quot;B: &quot; &lt;&lt; s; }
};
--

and a short code snipplet:

--
string hello = &quot;Hello&quot;;
A *a = new B;
a-&gt;[ctrl+space]
--
Here code completion offers both print-methods, therefore:
--
string hello = &quot;Hello&quot;;
A *a = new B;
a-&gt;print(hello)
--
As expected, gcc compiles the code, &quot;Hello&quot; is printed at stdout.

A small change:
--
string hello = &quot;Hello&quot;;
B *b = new B;
b-&gt;[ctrl+space]
--
Again, code completion offers both print methods.
--
string hello = &quot;Hello&quot;;
B *b = new B;
b-&gt;print(hello);
--
gcc complains:
--
home/daniel/cvs/test/src/test.cpp: In function `int main(int, char**)&apos;:
/home/daniel/cvs/test/src/test.cpp:51: error: no matching function for
call to `B::print(std::string)&apos;
/home/daniel/cvs/test/src/test.cpp:42: error: candidates are: virtual void
B::print(const char*)

----
Jens Dagerbo wrote (kdevelop-devel):

Quoting Eckel:
&quot;If a base class has a function name that&apos;s overloaded several times, 
redefining that function name in the derived class will hide _all_ the 
base-class versions.&quot;

I don&apos;t think this is the worst bug in the CC mechanism, but it is incorrect 
and should probably be reported. ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302903</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Franke">franke.daniel</who>
    <bug_when>2005-01-14 14:26:33 +0000</bug_when>
    <thetext>Still valid in kdevelop-3.1.91, KDE-3.3.91 (beta1), CVS 050113</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302905</commentid>
    <comment_count>2</comment_count>
    <who name="Amilcar do Carmo Lucas">amilcar</who>
    <bug_when>2005-01-14 14:33:51 +0000</bug_when>
    <thetext>Daniel seams to be a very good user. I trush him.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>502624</commentid>
    <comment_count>3</comment_count>
    <who name="David Nolden">david.nolden.kde</who>
    <bug_when>2007-01-19 20:02:12 +0000</bug_when>
    <thetext>Fixed in current svn</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>