Summary: | C++ import crash on "template<>" | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Alan Ezust <alan.ezust> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | burghart |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Alan Ezust
2005-08-08 17:35:42 UTC
Could you attach the problematic file (stripped down if possible) ? This looks like the same bug I'm seeing when trying to import a header which contains a template specialization. Umbrello will crash importing this simple (and legal) C++ fragment (condensed from the Boost library header /usr/include/boost/shared_ptr.hpp): ------------------------------------------------- template<class T> struct shared_ptr_traits { typedef T & reference; }; template<> struct shared_ptr_traits<void> { typedef void reference; }; ------------------------------------------------- Umbrello's class parser just doesn't like "template<>", which opens a parameterless template specialization. See Stroustrup's "The C++ Programming Language", 3rd edition, section 13.5 for details on template specialization. Thanks for clarifying. SVN commit 477565 by okellogg: BUG:110400 - Skip parsing of empty template. Thanks to Chris Burghart <burghart_AT_ucar.edu> for detailing the problem. M +3 -2 ChangeLog M +2 -0 umbrello/classparser/cpptree2uml.cpp M +2 -1 umbrello/classparser/parser.cpp --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #477564:477565 @@ -6,13 +6,14 @@ * Externalization of folders (i.e. submodel files) * Change interface into class and vice versa (if abstract and no attributes) * Image export via command line +* All diagram objects can be resized * Automatic Diagram Layout (67059, not yet closed) * Bugs fixed / wishes implemented (see http://bugs.kde.org) 57588 57672 58809 66461 67120 67719 72016 79433 87252 88117 97162 98368 101550 105564 107405 108223 109591 109636 110073 110216 -110231 110379 110843 111088 111470 111502 111759 111768 112017 112292 -112293 112333 112531 112552 112936 112991 112992 114892 +110231 110379 110400 110843 111088 111470 111502 111759 111768 112017 +112292 112293 112333 112531 112552 112936 112991 112992 114892 Version 1.4.2 (maintenance release) --- branches/KDE/3.5/kdesdk/umbrello/umbrello/classparser/cpptree2uml.cpp #477564:477565 @@ -170,6 +170,8 @@ void CppTree2Uml::parseTemplateDeclaration( TemplateDeclarationAST* ast ) { TemplateParameterListAST* parmListAST = ast->templateParameterList(); + if (parmListAST == NULL) + return; QPtrList<TemplateParameterAST> parmList = parmListAST->templateParameterList(); for (QPtrListIterator<TemplateParameterAST> it(parmList); it.current(); ++it) { // The template is either a typeParameter or a typeValueParameter. --- branches/KDE/3.5/kdesdk/umbrello/umbrello/classparser/parser.cpp #477564:477565 @@ -927,7 +927,8 @@ TemplateParameterListAST::Node params; if( lex->lookAhead(0) == '<' ){ lex->nextToken(); - parseTemplateParameterList( params ); + if (lex->lookAhead(0) != '>') + parseTemplateParameterList( params ); ADVANCE( '>', ">" ); } |