This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 131379

Summary: GNU style: formatter works wrong with functions if it returns struct
Product: cnd Reporter: soldatov <soldatov>
Component: EditorAssignee: Alexander Simon <alexvsimon>
Status: VERIFIED FIXED    
Severity: blocker CC: sustaining
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: patch for release61

Description soldatov 2008-03-28 09:19:14 UTC
Scenario:
- Set 'GNU' style
- Add such code:
tree
decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void
decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}

- Press 'Source|Format' menu item
==> I see function name on 9 column

tree
        decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void
decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}
Comment 1 soldatov 2008-03-28 09:24:06 UTC
Indentation works wrongly in this case also.

Type in editor:
tree<ENTER>
decl_shadowed_for_var_lookup (tree from)<ENTER>
{<ENTER>
==> I see in editor:
tree
        decl ()
{

}
Comment 2 Alexander Simon 2008-03-28 10:12:25 UTC
fixed
http://hg.netbeans.org/main/rev/f311bebc720c
Comment 3 soldatov 2008-03-29 12:04:09 UTC
Second scenario is not fixed.
And other scenario:
- Set 'GNU' style
- Add such code:
tree decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}

- Press 'Source|Format' menu item
==> Function name on old position
tree decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void
decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}
Comment 4 Alexander Simon 2008-03-31 15:15:03 UTC
fixed in main
http://hg.netbeans.org/main/rev/1b230feca924
Comment 5 Alexander Simon 2008-03-31 15:16:44 UTC
Created attachment 59412 [details]
patch for release61
Comment 6 Alexander Simon 2008-03-31 17:22:52 UTC
Additional fix in IZ.
http://www.netbeans.org/issues/show_bug.cgi?id=131647
http://hg.netbeans.org/main/rev/3c24eff316d3
I.e. if IZ#131379 will be integrated in release the IZ#131647 should be integrated also.
Comment 7 soldatov 2008-04-01 10:38:24 UTC
verified.

verified in build 200803302302 + patches from IZ#131379 and IZ#131647
Comment 8 rbalada 2008-04-29 15:24:58 UTC
I've transplanted the changeset http://hg.netbeans.org/main/rev/1b230feca924
into release61_fixes repository as http://hg.netbeans.org/release61_fixes/rev/

changeset:   77509:9b539fcb0779
tag:         tip
user:        Alexander Simon <alexvsimon@netbeans.org>
date:        Mon Mar 31 18:06:42 2008 +0400
summary:     fixed IZ#131379:GNU style: formatter works wrong with functions if it returns struct
Comment 9 rbalada 2008-04-29 15:45:37 UTC
Oops, correct URL to release61_fixes changeset is http://hg.netbeans.org/release61_fixes/rev/9b539fcb0779