Bug 171882 - "Create New Class" feature #includes the generated cpp in itself
Summary: "Create New Class" feature #includes the generated cpp in itself
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-30 04:05 UTC by Casey Link
Modified: 2008-10-03 02:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Casey Link 2008-09-30 04:05:30 UTC
Version:           SVN (using Devel)
Compiler:          gcc (GCC) 4.2.3  (Ubuntu 4.2.3-2ubuntu7) 
OS:                Linux
Installed from:    Compiled sources

When you create a new class in Kdev4 the resulting .cpp file #includes itself, which causes an infinite #include loop. Which crashes kdev (this crash I suppose is a separate parser bug).

To reproduce:
1. Code > Create New Class
2. Run Through the Wizard
3. Specify a NewClass.h and NewClass.cpp as filenames (actual name doesn't matter)
4. Open the new NewClass.cpp file, and see the #include "NewClass.cpp"
5. Let the parser parse the new file -> crash!

Expected Behavior:
NewClass.cpp should #include "NewClass.h"
Comment 1 David Nolden 2008-10-02 03:26:17 UTC
Ok, I have fixed the crash. Instead the problem-reporter will show a problem now. The class-wizard is another story though. :)
Comment 2 Andreas Pakulat 2008-10-02 09:35:58 UTC
Then this particular bug is not fixed. So it needs to stay open.
Comment 3 Casey Link 2008-10-03 02:44:30 UTC
link * r867181 languages/trunk/KDE/kdevelop/languages/cpp/codegen/cppnewclass.cpp:
Fixes a little typo so the new class generator won't self include the implementation file.