Bug 64786

Summary: c++ parser reports problem at ranged case statement
Product: [Applications] kdevelop Reporter: Gunther Piez <gpiez>
Component: Language Support: CPP (old)Assignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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