Bug 204665 - cpp-parser can not parse switch statement without explicitly opened scope
Summary: cpp-parser can not parse switch statement without explicitly opened scope
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: LO minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 264482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-21 16:32 UTC by gramic
Modified: 2013-03-31 00:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gramic 2009-08-21 16:32:20 UTC
Version:            (using KDE 4.2.4)
Compiler:          gcc 4.3 
OS:                Linux
Installed from:    Ubuntu Packages

When there is a switch statement like this code:

switch(0) case 0:;

the parser reports: unexpected token 'case'

if there is explicit scope (the curly braces) like this:

switch (0){case 0:;};

everything is fine
Comment 1 Sebastian Dörner 2011-01-27 21:44:40 UTC
*** Bug 264482 has been marked as a duplicate of this bug. ***
Comment 2 Olivier.jg 2011-02-17 10:24:31 UTC
Git commit d61179ce2d404a82b1ea97f9a1149d0b3b9ef4e4 by Olivier JG.
Committed on 17/02/2011 at 10:21.
Pushed by olivierjg into branch 'master'.

Allow switch statement without brackets, add tests.
BUG: 204665

M  +5    -5    languages/cpp/parser/parser.cpp     
M  +22   -0    languages/cpp/parser/tests/test_parser.cpp     

http://commits.kde.org/kdevelop/d61179ce2d404a82b1ea97f9a1149d0b3b9ef4e4
Comment 3 Olivier.jg 2011-02-17 11:15:57 UTC
Git commit 5df2d0b3f7a307aa5a2fba70bb084c2d50afe747 by Olivier JG.
Committed on 17/02/2011 at 10:21.
Pushed by olivierjg into branch '4.2'.

backport from master:
Allow switch statement without brackets, add tests.
BUG: 204665

M  +5    -5    languages/cpp/parser/parser.cpp     
M  +22   -0    languages/cpp/parser/tests/test_parser.cpp     

http://commits.kde.org/kdevelop/5df2d0b3f7a307aa5a2fba70bb084c2d50afe747
Comment 4 Aleix Pol 2013-03-31 00:48:57 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively