Bug#2275: Incomplete forward declaration of a class causes kdevelop to crash

Kalle Pahajoki pahajoki at voimax.cygnnet.jkl.fi
Wed Nov 10 21:54:49 UTC 1999

Package: kdevelop
Version: 1.0beta4.1
Severity: normal

Bugreport ID : 21:29,10.11.99

Originator      : Kalle Pahajoki
E-Mail          : pahajoki at voimax.cygnnet.jkl.fi

Subject : Incomplete forward declaration of a class causes kdevelop to crash

Error Class     : software bug
Error Location  : class tree
Priority        : medium

Bug Description ---------------------------

(Reading bugs.kde.org I noticed some reports that seem to describe the
same problem. However, they seem to be a little sketchy, so I'll send this
in the hope that it will be of use to you)

I have a header file for class Foo. The class Foo contains a pointer to
class Bar, so I was forward declaring class Bar in foo.h. Having only
typed in "class ", kdevelop tried to autosave and crashed.
I ran kdevelop from konsole, and it gave me the segfault with the
following message:

Path: /blah/blah
File: foo.h
Path: /blah/blah
File: foo.cpp
CClassView::refresh( proj )
So I looked at the file foo.h and completed the declaration of class Bar,
after which kdevelop run just fine.
I tested this further, and found out that:
        class class cow {};
would cause kdevelop to crash, while (for example):
        class int cow;
worked just fine.

(I talk about saving here, but the problem probably occurs every time
kdevelop refreshes the class tree, which just happens to happen when saving)

How to repeat the error -------------------

1. Create a new project.
2. Add to one of the header files (that gets included) the line:
class class Foo {};
3. Wait for autosave or select Save from File-menu

Bugfix or Workaround ----------------------

Do not save while forward declaring a class, and try to time doing it
between autosaves ;-)

System Information ------------------------

KDevelop version        : 1.0beta4.1
KDE version             : 1.1.2
QT version              : 1.44
OS/Distribution         : Linux 2.2.13 / Red Hat 6.0
Compiler                : egcs-1.1.2

misc :

More information about the KDevelop-devel mailing list