Bug 82977 - [testcase]Cannot import class which ends with a comment
Summary: [testcase]Cannot import class which ends with a comment
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Oliver Kellogg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-07 10:01 UTC by Martin Koller
Modified: 2004-08-10 08:02 UTC (History)
1 user (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 Martin Koller 2004-06-07 10:01:26 UTC
Version:           1.2.90 (using KDE 3.2.90 (3.3 alpha1, CVS >= 20040522), compiled sources)
Compiler:          gcc version 3.2.3
OS:                Linux (i686) release 2.4.22

The simple following class can not be imported.
If I remove the comment line, then it works.

class TEST
{
  // just a comment
};
Comment 1 Jonathan Riddell 2004-06-12 20:31:10 UTC
Confirmed, how peculiar.
Comment 2 Oliver Kellogg 2004-07-06 09:19:41 UTC
I've fixed it for the common case of a trailing comment on a member variable:

class TEST {
    int x;   // just a comment
};

Roberto, I think this could be a candidate for backporting to kdevelop (?)
See
	kdesdk/umbrello/umbrello/classparser/parser.h  rev. 1.2
	kdesdk/umbrello/umbrello/classparser/parser.cpp  rev. 1.4
Comment 3 Oliver Kellogg 2004-07-25 15:43:22 UTC
*** Bug has been marked as fixed ***.
Comment 4 Oliver Kellogg 2004-08-09 18:55:32 UTC
I find that it still doesn't work for enums:

enum MyEnumType {
   zero,  // ouch, this comment throws us off the handle
   one
};

As soon as there's a comment at the end of an enum literal
the class import for the enum, including any surrounding scope
such as class or namespace, fails.

I have the fix for this ready - should I commit?
Comment 5 Oliver Kellogg 2004-08-10 08:02:49 UTC
fixed by parser.cpp:1.6