Bug 64786 - c++ parser reports problem at ranged case statement
Summary: c++ parser reports problem at ranged case statement
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-23 10:30 UTC by Gunther Piez
Modified: 2013-03-31 00:46 UTC (History)
0 users

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 Gunther Piez 2003-09-23 10:30:40 UTC
Version:            (using KDE KDE 3.1.3)
Installed from:    Compiled From Sources
Compiler:          3.3.1 
OS:          Linux

switch(foo) {
case 'b' ... 'r':
	something();
}

reports a problem at the case line.
Comment 1 Amilcar do Carmo Lucas 2003-11-01 18:35:18 UTC
This is not very standard C code...
Maybe we can close this one as wont fix.
Roberto?
Comment 2 Roberto Raggi 2003-11-04 16:20:01 UTC
Subject: kdevelop/lib/cppparser

CVS commit by raggi: 

gnu extension: case 'a' ... 'z':

CCMAIL: 64786-done@bugs.kde.org


  M +7 -0      parser.cpp   1.23


--- kdevelop/lib/cppparser/parser.cpp  #1.22:1.23
@@ -2735,4 +2735,11 @@ bool Parser::parseLabeledStatement( Stat
         if( !parseConstantExpression(expr) ){
             reportError( i18n("expression expected") );
+        } else if( lex->lookAhead(0) == Token_ellipsis ){
+            lex->nextToken();
+            
+            AST::Node expr2;
+            if( !parseConstantExpression(expr2) ){
+                reportError( i18n("expression expected") );
+            }
         }
         ADVANCE( ':', ":" );


Comment 3 Aleix Pol 2013-03-31 00:46:50 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