1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 261967 - Format produces error for __attribute__ ((__unused__)) flag

This commit is contained in:
Anton Leherbauer 2009-01-22 10:33:11 +00:00
parent f0a16ef93a
commit c0cbc9010d
3 changed files with 10 additions and 2 deletions

View file

@ -436,7 +436,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
// declarator
final IASTDeclarator declarator= node.getDeclarator();
if (declarator != null) {
skipNonWhitespaceToNode(declarator);
boolean needSpace= declarator.getPointerOperators().length > 0 && scribe.printComment();
if (needSpace) {
scribe.space();

View file

@ -1709,9 +1709,12 @@ public class Scribe {
fSkippedIndentations--;
}
} else if (offset > currentPosition) {
printComment();
boolean hasSpace= printComment();
final int nextPosition= scanner.getCurrentPosition();
if (offset > nextPosition) {
if (hasSpace) {
space();
}
printRaw(nextPosition, offset - nextPosition);
scanner.resetTo(offset, scannerEndPosition - 1);
}

View file

@ -1130,4 +1130,10 @@ public class CodeFormatterTest extends BaseUITestCase {
assertFormatterResult();
}
//bool member __attribute__ ((__unused__)) = false;
//bool member __attribute__ ((__unused__)) = false;
public void testPreserveSpaceBetweenNameAnd__attribute__Bug261967() throws Exception {
assertFormatterResult();
}
}