mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Bug 269590 - Format error for global const typename
This commit is contained in:
parent
80ddff81ed
commit
2c3979ce37
2 changed files with 13 additions and 3 deletions
|
@ -1352,15 +1352,15 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int visit(IASTNamedTypeSpecifier node) {
|
private int visit(IASTNamedTypeSpecifier node) {
|
||||||
|
if (scribe.printModifiers()) {
|
||||||
|
scribe.space();
|
||||||
|
}
|
||||||
if (node instanceof ICPPASTNamedTypeSpecifier) {
|
if (node instanceof ICPPASTNamedTypeSpecifier) {
|
||||||
if (((ICPPASTNamedTypeSpecifier)node).isTypename()) {
|
if (((ICPPASTNamedTypeSpecifier)node).isTypename()) {
|
||||||
scribe.printNextToken(Token.t_typename);
|
scribe.printNextToken(Token.t_typename);
|
||||||
scribe.space();
|
scribe.space();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scribe.printModifiers()) {
|
|
||||||
scribe.space();
|
|
||||||
}
|
|
||||||
node.getName().accept(this);
|
node.getName().accept(this);
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1157,4 +1157,14 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
assertFormatterResult();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue