| Summary: | Incorrect source code formatting when using BOOST_FOREACH | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Michael <michael.fomin> |
| Component: | cdt-other | Assignee: | Doug Schaefer <cdtdoug> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | marco.stornelli, Tones, yevshif |
| Version: | 8.0 | ||
| Target Milestone: | 9.8.0 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
With CDT 8.1.2 the autoformatting results look different, but still not in the way it is supposed to be:
void foo()
{
std::vector<int> vec;
BOOST_FOREACH(int & i, vec){
++i;
}
}
Changing the active formatter profile does not seem to resolve the isssue.
I used this code:
#include <string>
#include <iostream>
#include <vector>
#include <boost/foreach.hpp>
int main() {
std::string hello("Hello, world!");
std::vector<int> vec;
BOOST_FOREACH( int i, vec ) {
std::cout << i;
}
return 0;
}
I can't reproduce this problem with CDT 9.7
|
Build Identifier: 20110615-0604 The Eclipse source code formatter (Ctrl+Shift+F) incorrectly formats code that includes the boost library BOOST_FOREACH macro. As shown: void foo() { vector<int> vec; BOOST_FOREACH(int i, vec) { } } We can see the first '{' after the macro has 2 additional tabs. Reproducible: Always Steps to Reproduce: 1. Create C++ project 2. Use BOOST_FOREACH in function 3. Auto format code (Ctrl+Shift+F)