Bug 68131

Summary: C++ parser problem with declarations in the first field of "for" statement
Product: [Applications] kdevelop Reporter: Sylvain Joyeux <sylvain.joyeux>
Component: Code completionAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Sylvain Joyeux 2003-11-13 17:05:06 UTC
Version:           CVS of 06 november 2003 (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages
OS:          Linux

when writing the following :

struct foo
{
  int a;
  int b;
};

int bar()
{
  struct foo test[5];

  for (foo* current = test; current; ++current)
    current ->
}

the type of "current" is not guessed (after the ->), whereas it is when writing
  foo* current;
  for (current = test; current; ++current)
    current ->
Comment 1 Adam Treat 2005-03-11 05:43:39 UTC
This has been fixed although it'll be another day before I can fix it for blocks that don't have {} enclosing the statement list.

Here is the cvs message:

CVS commit by treat: 

* Complete on vars declared in the init part of a for loop and make completion
work on the conditional part of an if/else


  M +5 -6      cppcodecompletion.cpp   1.160