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

 
 
Show feedback again

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

Submitted by:  None
Submitted on:  Thu 22 Mar 2012 01:08:29 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
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.

 

Thu 22 Mar 2012 10:38:53 AM UTC, 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 22 Mar 2012 01:08:29 AM UTC, 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:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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):

 

 

No Changes Have Been Made to This Item
Show feedback again

Back to the top


Powered by Savane 3.1-cleanup