Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java6
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java11
2 files changed, 13 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
index a0aa7fef18c..668090c55f3 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
@@ -1358,15 +1358,15 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
}
private int visit(IASTNamedTypeSpecifier node) {
+ if (scribe.printModifiers()) {
+ scribe.space();
+ }
if (node instanceof ICPPASTNamedTypeSpecifier) {
if (((ICPPASTNamedTypeSpecifier)node).isTypename()) {
scribe.printNextToken(Token.t_typename);
scribe.space();
}
}
- if (scribe.printModifiers()) {
- scribe.space();
- }
node.getName().accept(this);
return PROCESS_SKIP;
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
index 75405cdf375..8baf9fde4da 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java
@@ -1112,5 +1112,14 @@ public class CodeFormatterTest extends BaseUITestCase {
assertFormatterResult();
}
-
+ //inline typename A foo();
+ //void bar(const typename A x) ;
+ //static typename A x ;
+
+ //inline typename A foo();
+ //void bar(const typename A x);
+ //static typename A x;
+ public void testFormatterProblemsWithTypename_Bug269590() throws Exception {
+ assertFormatterResult();
+ }
}

Back to the top