1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 321069 ASTWriter fails on IASTDeclarators with nested declarators, patch from Tomasz Wesolowski

This commit is contained in:
Alena Laskavaia 2010-08-01 23:51:22 +00:00
parent 69665fb352
commit 43fc6eaaac
2 changed files with 15 additions and 0 deletions

View file

@ -92,6 +92,20 @@ int b, a;
} }
//!ICPPASTDeclarator with nested declarator being a variable
//%C
int *(*var[3]);
//!ICPPASTDeclarator with nested declarator and redundant parentheses
//%C
char (*((*fptr))(int, char));
//!ICPPASTDeclarator with nested declarator as a method
//%CPP
class Foo
{
int (*(*aMethod())[2]);
};
//!ICPPASTReferenceOperator rvalue reference //!ICPPASTReferenceOperator rvalue reference
//%CPP //%CPP
int && foo(int && a) int && foo(int && a)

View file

@ -79,6 +79,7 @@ public class DeclaratorWriter extends NodeWriter {
writePointerOperators(declarator, pointOps); writePointerOperators(declarator, pointOps);
IASTName name = declarator.getName(); IASTName name = declarator.getName();
name.accept(visitor); name.accept(visitor);
writeNestedDeclarator(declarator);
IASTInitializer init = getInitializer(declarator); IASTInitializer init = getInitializer(declarator);
if(init!= null) { if(init!= null) {
init.accept(visitor); init.accept(visitor);