bugGNU indent - Bugs: bug #35943, Indention in C++11 fails on ranged...

 
 

bug #35943: Indention in C++11 fails on ranged based for loops

Submitted by:  None
Submitted on:  Thu Mar 22 01:08:29 2012  
 
Category: C++Severity: 3 - Normal
Item Group: NoneStatus: Postponed
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon Mar 24 03:38:42 2014, comment #5:

The proposed patch causes many regression tests to fail. If a working solution is proposed that does not break current functionality, we can consider it.

Daniel P. Valentine <dpv>
Project Administrator
Mon Jun 3 21:59:32 2013, comment #4:

correct regression in class

(file #28248)

Kéwan Marconnet <tharvik>
Mon Jun 3 21:32:04 2013, comment #3:

Oups, forgot the add to the buffer, not replace

(file #28245)

Kéwan Marconnet <tharvik>
Mon Jun 3 21:23:42 2013, comment #2:

This patch should do it.

(file #28244)

Kéwan Marconnet <tharvik>
Thu Mar 22 10:38:53 2012, comment #1:

Savanah stole the tabulators, so: The examples were:

1)
int main(){
vector<int> v;
for(auto x:v){
do_something();
}
}

2)
int main(){
\tvector<int> v;
\tfor(auto x:v){
\t\tdo_something();
\t}
}

3)
int main(){
\tvector<int> v;
\ for(auto x:v){ //one space at the beginning
\tdo_something();
\t}
}

Anonymous
Thu Mar 22 01:08:29 2012, original submission:

If your code is

int main(){
vector<int> v;
for(auto x:v){
do_something();
}
}

the expected output of “indent -brf -brs -linux file.cpp” would be:

int main() {
vector<int> v;
for (auto x:v) {
do_something();
}
}

However, what you get is:

int main(){
vector<int> v;
for (auto x:v) {
do_something();
}
}

The Manpage states, that this tool is not primary for use with C++; nevertheless it would be cool if this could be fixed.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #28274:  foreach.patch added by tharvik (978B - application/octet-stream)
file #28249:  2.2.11-foreach.patch added by tharvik (591B - application/octet-stream - Return on end)
file #28248:  foreach.patch added by tharvik (570B - application/octet-stream - Correct regression in class)
file #28245:  2.2.11-foreach.patch added by tharvik (604B - application/octet-stream - Replace previous patch)
file #28244:  foreach.patch added by tharvik (602B - application/octet-stream - Correct the foreach wrong indent)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dpv (Updated the item)
  • -unavailable- added by tharvik (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Mar 24 03:38:42 2014dpvStatusNone=>Postponed
    Mon Mar 24 03:36:33 2014dpvCategoryNone=>C++
    Thu Jun 6 19:48:09 2013tharvikAttached File-=>Added foreach.patch, #28274
    Mon Jun 3 22:49:20 2013tharvikAttached File-=>Added 2.2.11-foreach.patch, #28249
    Mon Jun 3 22:05:00 2013tharvikCarbon-CopyRemoved tharvik=>-
    Mon Jun 3 21:59:32 2013tharvikAttached File-=>Added foreach.patch, #28248
    Mon Jun 3 21:32:04 2013tharvikAttached File-=>Added 2.2.11-foreach.patch, #28245
    Mon Jun 3 21:23:42 2013tharvikAttached File-=>Added foreach.patch, #28244
    Sun Jun 2 20:53:19 2013tharvikCarbon-Copy-=>Added tharvik

    Back to the top


    Powered by Savane 3.1-cleanup