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:
parent
69665fb352
commit
43fc6eaaac
2 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue